The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-03-2009
sdosanjh sdosanjh is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 27
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
  #2 (permalink)  
Old 01-05-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,864
This doesn't work. Are you trying to say that when you log into machine X you want shell XS, but if you log into machine Y you want shell XY? Is the password/login information common to both machines? Will the administrator let you make very simple changes to the configuration of either host?
  #3 (permalink)  
Old 01-06-2009
sdosanjh sdosanjh is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 27
Quote:
Originally Posted by otheus View Post
This doesn't work. Are you trying to say that when you log into machine X you want shell XS, but if you log into machine Y you want shell XY? Is the password/login information common to both machines? Will the administrator let you make very simple changes to the configuration of either host?

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!!!!
  #4 (permalink)  
Old 01-12-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,864
I'm sorry I dropped the ball on this one...

Again, are you saying you want to use a different shell for interactive use? Or do you want to launch a program for each of the servers in ServerNames.txt ?
  #5 (permalink)  
Old 01-12-2009
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:56 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0