script closing window
Hello! I'm new to this site, and trying to refresh my memory from 5 years ago since I last worked with Oracle and Unix. So please be patient with me! LOL
I have a shell script using sh that whenever I run it, it closes my Putty session! The script has only 2 lines, an echo statement and the first is the #!/bin/sh command....any help would be much appreciated! thanks! |
Can you show a copy of the script?
|
script
I had even commented out the echo statement and it still closes the window? here's the exact contents of the script - I wrote using the VI editor so that there shouldn't be any problems with return characters...
#!/bin/sh #echo "starting script"; |
also tried
I also tried using the printf function instead of echo, but that closes my putty session as well....
|
*How* are you running this script? Step by step, please.
That script does actually nothing because everything is commented out. At most, it should echo a message if you uncoment the 2nd line. |
running script
I'm logging into putty, using the "cd" command I'm going to the directory where the script is stored, and then I'm typing in "exec <scriptname>"
I know the script isn't really doing anything, I'm just trying to get started on verifying that an easy script (like this one) will work so that I can figure out why another script is not working by adding in pieces/parts of the other script, but I don't want it to close putty all the time - don't want to keep logging back in - does that make sense? |
another try
I have also just tried the below script, and it worked - displayed the #1, but as soon as I put the last line in ("echo script started;") it closes the window - tried it with and without the quotes around script started....
#!/bin/sh export LeisaNbr=0; let "LeisaNbr = LeisaNbr + 1"; echo $LeisaNbr; echo script started; |
Quote:
Quote:
Code:
sh <scriptname> Code:
chmod a+x <scriptname> |
Thank you!!!
that worked!!
|
All times are GMT -5. The time now is 04:46 AM. |