![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bash shell script | outthere_3 | UNIX for Dummies Questions & Answers | 2 | 01-31-2008 08:13 PM |
| BASH Shell Script Help -HELP! | flamethrower0 | Shell Programming and Scripting | 2 | 12-30-2006 01:26 AM |
| bash shell script and ms-dos | space13 | Shell Programming and Scripting | 1 | 11-10-2006 07:06 PM |
| need help with bash shell script | vmtailor | UNIX for Dummies Questions & Answers | 2 | 03-03-2005 04:30 PM |
| bash shell script | norsk hedensk | Shell Programming and Scripting | 4 | 08-02-2003 07:27 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi All,
I am in Bash Shell and Running A script that contains Exit statement in that in last ( to return to sh shell after executing) But it is not coming to sh shell after the script is excuted. How to return to sh shell from bash shell through a script. |
|
||||
|
Please post your code or use "sh -x scriptname " to see its execution to find out where it gets hang
|
|
||||
|
Actually i m just redirecting the output of single command to a file name ( for the Database)
through a script ping localhost > abc.sh$"$(date ' +%d%b%y')".lst exit Case1) Bash-3.2#./abc.sh Bash-3.2# output)abc28Aug.lst == correct output=== Case2) #./abc.sh output) abc$$(date '+%d%b%y').lst ===wrong output===== After executing in a bash shell it should not come to bash shell , i want to run the script from the sh shell only ? |
|
||||
|
Quote:
Quote:
Code:
#!/usr/bin/bash ping localhost > abc.sh$"$(date ' +%d%b%y')".lst Code:
#!/usr/bin/bash ping localhost > abc.sh$(date '+%d%b%y').lst |
|
||||
|
Probably you end up running a different version of ping which just keeps on looping forever. Perhaps your PATH is different in Bash than in the regular Bourne shell. Try specifying an explicit pathname like /bin/ping or whatever works for you.
Some versions of ping accept an argument -c 1 which says to send only one packet and then quit (or any number after -c of course); if not specified, they will loop forever. If your shell doesn't understand $(...) you can use `...` instead (those are grave accents -- ASCII 96 -- not regular straight apostrophes). |
![]() |
| Bookmarks |
| Tags |
| bash, shell |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|