![]() |
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 |
| Changing value of a variable inside a shell script | kshyju | Shell Programming and Scripting | 1 | 12-12-2008 05:06 AM |
| How to run cmds after changing to a new env (shell) in a shell script | charlei | Shell Programming and Scripting | 6 | 10-14-2008 03:18 PM |
| Changing cursor position using shell script | balamv | Shell Programming and Scripting | 2 | 06-02-2008 01:10 PM |
| Password changing in a Script (shell and expect) | chellam | Shell Programming and Scripting | 1 | 08-14-2006 11:12 PM |
| Changing korn shell script text Menu colors? | darthur | UNIX for Dummies Questions & Answers | 6 | 01-20-2002 07:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Regarding changing shell thru script
Guys can I change the shell thru script, and after changing i want the script to continue on the previous machine.
Or please suggest other alternative if any??? #!/bin/ksh HOST=`hostname` echo "Running the script..." for MyServer in `cat ServerNames.txt` do echo "\n Logging onto $MyServer" ssh $MyServer -l Myname ksh /tmp/Get_ParserInfo.ksh.ORG echo " Script completed on $MyServer " done |
|
||||
|
Quote:
Thats the problem dude..... admin restrictions... So what i did was...i used "here document" concept in the script for MyServer in `cat ServerNames.txt` do echo "\n Logging onto $MyServer" ssh $MyServer -l nyop <<EOT ksh /tmp/Get_ParserInfo.ksh.ORG EOT echo " Script completed on $MyServer " By this i was able to run the the script by logging onto other shell from my current shell Hope dint confuse you!!!! ![]() |
|
|||||
|
The question here is , WHY you want to change the shell the script runs on? Maybe you mean "user" rather than "shell"?
Different shells have enough different syntax that could rend a script useless if run that script on a different shell it was written on. For example, a perfectly working ksh array will yield you errors on sh, csh, bash. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|