Not sure how to post this, I'll just come out with it gang...
I ran into some trouble loading certain commands using an editor called "pico editor". All was working fine and suddenly stopped responding to my commands which I'll post in a bit; which contained the characters mentioned above...
So I thought okay I'll try another editor, lo and behold, I cannot run the code there either because this editor does not like me adding #!/bin/sh, and has deleted these chars rendering the code virtually unusable.
Is there a command I need to add in order for the vi editor to accept #! in the code. pico is not working and I have since driven to the college just case it was my network, same treatement there: -
#!/bin/sh
-
#sample shell using the if
-
echo "Let's create a fancy directory"
-
if [ -d unixbackup ]
-
then
-
echo "directory unixbackup exists"
-
else
-
echo "Looks like directory unixbackup does not exist"
-
echo "Would you like to create it now? (y/n)"
-
read x
-
echo $x
-
if [ $x = "y" ]
-
then
-
mkdir unixbackup
-
echo "Super! unixbackup directory has been created"
-
else
-
echo "Sorry! unixbackup directory has not been created"
-
fi
-
fi
-
It's nothing fancy but if I could run it through the vi editor, it would be great.
What are your thoughts?
Thanks!
Dököll
5 2401
Not sure how to post this, I'll just come out with it gang...
I ran into some trouble loading certain commands using an editor called "pico editor". All was working fine and suddenly stopped responding to my commands which I'll post in a bit; which contained the characters mentioned above...
So I thought okay I'll try another editor, lo and behold, I cannot run the code there either because this editor does not like me adding #!/bin/sh, and has deleted these chars rendering the code virtually unusable.
Is there a command I need to add in order for the vi editor to accept #! in the code. pico is not working and I have since driven to the college just case it was my network, same treatement there: -
#!/bin/sh
-
#sample shell using the if
-
echo "Let's create a fancy directory"
-
if [ -d unixbackup ]
-
then
-
echo "directory unixbackup exists"
-
else
-
echo "Looks like directory unixbackup does not exist"
-
echo "Would you like to create it now? (y/n)"
-
read x
-
echo $x
-
if [ $x = "y" ]
-
then
-
mkdir unixbackup
-
echo "Super! unixbackup directory has been created"
-
else
-
echo "Sorry! unixbackup directory has not been created"
-
fi
-
fi
-
It's nothing fancy but if I could run it through the vi editor, it would be great.
What are your thoughts?
Thanks!
Dököll
I code in vi when using *nix all the time and have never had any issue where it removed text without me removing it. Just save the file after adding the text. Have you tried adding the text in vi and see if it happens. I don't see why a text editor would care what text you put into it. Unless it was placed in its command interface. In vi, if you hit escape -> : that puts you into command mode and if you enter something after the colon, then it would be interpreted as a command and not text.
Regards,
Jeff
I code in vi when using *nix all the time and have never had any issue where it removed text without me removing it. Just save the file after adding the text. Have you tried adding the text in vi and see if it happens. I don't see why a text editor would care what text you put into it. Unless it was placed in its command interface. In vi, if you hit escape -> : that puts you into command mode and if you enter something after the colon, then it would be interpreted as a command and not text.
Regards,
Jeff
Hey Jeff, good advice!
I don't think I saved after adding the code there. Perhaps I was disoriented since pico runs a bit differently.
Will give it a whirl again, thanks Jeff!
Köll
Hey Jeff, good advice!
I don't think I saved after adding the code there. Perhaps I was disoriented since pico runs a bit differently.
Will give it a whirl again, thanks Jeff!
Köll
By the way, Jeff...
Why would I get a "terminal too wide" type of an error? Now and then when I have a lot of code in the editor it seems to throw that message down below.
In a bit!
By the way, Jeff...
Why would I get a "terminal too wide" type of an error? Now and then when I have a lot of code in the editor it seems to throw that message down below.
In a bit!
Please disregard the above. Looks like vi does not like the screen maximized. That's news to me.
The command now works and as mentioned vi does not delete stuff, my silly way of looking at it failed me:-)
Will be using vi more often to grab some tips.
The problem I am having now is that, I cannot remove my directory: -
#!/bin/sh
-
#Sample Shell to remove directory...
-
-
echo "Let's delete a fancy directory"
-
if [ -d unixbackup ]
-
then
-
echo "directory unixbackup exists"
-
echo "Would you like to delete it now? (y/n)"
-
read x
-
echo $x
-
if [ $x = "y" ]
-
then
-
rmdir unixbackup
-
echo "Super! unixbackup directory has been deleted"
-
else
-
echo "Sorry! unixbackup directory has not been deleted"
-
fi
-
fi
-
After giving myself full access to a script file containing above command through SSH Secure Shell, I get a Command not found. It was working before.
I attempted to back track, just to see if I had done something like delete the script by accident, still nothing.
What do you think may be happening?
Thanks for your help!
Please disregard the above. Looks like vi does not like the screen maximized. That's news to me.
The command now works and as mentioned vi does not delete stuff, my silly way of looking at it failed me:-)
Will be using vi more often to grab some tips.
The problem I am having now is that, I cannot remove my directory: -
#!/bin/sh
-
#Sample Shell to remove directory...
-
-
echo "Let's delete a fancy directory"
-
if [ -d unixbackup ]
-
then
-
echo "directory unixbackup exists"
-
echo "Would you like to delete it now? (y/n)"
-
read x
-
echo $x
-
if [ $x = "y" ]
-
then
-
rmdir unixbackup
-
echo "Super! unixbackup directory has been deleted"
-
else
-
echo "Sorry! unixbackup directory has not been deleted"
-
fi
-
fi
-
After giving myself full access to a script file containing above command through SSH Secure Shell, I get a Command not found. It was working before.
I attempted to back track, just to see if I had done something like delete the script by accident, still nothing.
What do you think may be happening?
Thanks for your help!
About this problem!
Well, I must be losing my marbles but I deleted my .cshrc and .longin files after making copies of them.
All is well now:-)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jason Tesser |
last post by:
What is the best overall ide studio that can be used to develop crossplatform apps (win,linux,mac) for python?
Jason Tesser
Web/Multimedia Programmer
Northland Ministries Inc.
(715)324-6900...
|
by: ChinStrap |
last post by:
When not using the interactive prompt, what are you using? I keep
hearing everyone say Emacs, but I can't understand it at all. I keep
trying to learn and understand why so many seem to like it...
|
by: SD |
last post by:
I am thinking about writing a text editor in C for unix sometime soon.
I am just doing this to learn more about C. I want to write something
like ed.c, a simple line editor. What types of data...
|
by: Desmond Cassidy |
last post by:
Hi,
I don't know whether this is the correct place to ask this question..anyway
here goes...
I have a large solution with about 300 .vb files split into 9 projects
VB.net Framework 1.1 WinXP...
|
by: google |
last post by:
Hello all-
Apologies to everyone for what's probably a very inchoate and
uninformed question, but I've been thrust into the position about
having to learn more about PHP very quickly. (I'm also...
|
by: John Salerno |
last post by:
I know there's a request for a good IDE at least once a week on the ng,
but hopefully this question is a little different. I'm looking for
suggestions for a good cross-platform text editor (which...
|
by: saurabh.ss |
last post by:
I want a C++ editor for Linux that resembles Microsoft Visual Studio's
integrated editor. I mean it should have features like auto-completion,
auto-indentation and syntax highlighting. Also it...
|
by: sid |
last post by:
Hi!
I am sorry that I am asking a little off topic question, but I am
sure some of you can surely help me. I am writiing a VI like text
editor in C++ for the console. I would like to know some...
|
by: Hallvard B Furuseth |
last post by:
I wrote:
Okay, I've seriously miscommuniated here...
If I do this, I'll reformat the code to what will become the project's
new style, and commit the results. Assuming it gets OKed. When...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| | |