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
SSH prompts password for non identical users vjkatsun UNIX for Advanced & Expert Users 5 06-02-2008 01:18 AM
Shell Program that prompts for user Id mmg2711 Shell Programming and Scripting 16 10-25-2007 01:09 PM
password prompts balag UNIX for Advanced & Expert Users 2 01-05-2006 02:19 PM
scripting password prompts hcclnoodles Shell Programming and Scripting 3 03-21-2005 04:25 PM
rsh help with remote prompts ianf Shell Programming and Scripting 4 09-02-2002 10:55 AM

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 08-30-2007
gopsman gopsman is offline
Registered User
  
 

Join Date: May 2007
Posts: 25
working in different prompts

hi

i want a script which would invoke a different prompt and execute commands in that prompt and comes back. Is it possible?
  #2 (permalink)  
Old 08-30-2007
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Which flavour of unix you are using.
for solaris if you want to change your prompt
echo $PS1 will tell you the prompt.
you neet to type
PS1=#
or
PS1=@

or
PS1="`hostname`{`logname`}"
whatever you want.Then execute the coomads whichever you want.

then press ^d you will be taken out of that shell.
you will again prompt to the original shell.

Thanks
Namish
  #3 (permalink)  
Old 08-30-2007
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by gopsman View Post
hi

i want a script which would invoke a different prompt and execute commands in that prompt and comes back. Is it possible?
What kind of prompt ? A new shell or a new xterm window ?

For xterm, you can probably use
Code:
xterm -e <progname> [args]
See man xterm for more details.

For shell, you can use the -c flag i.e.
Code:
[k]sh -c
See man sh/ksh
  #4 (permalink)  
Old 08-30-2007
gopsman gopsman is offline
Registered User
  
 

Join Date: May 2007
Posts: 25
to nimish and vino

hi

my scenario is like this. i have telnetted to a machine. in that i have to run a process for which i have to change the prompt to say 'XYZ'. then in that prompt i have to stop a process by the command say, 'stop-process'. then i would quit that prompt by 'exit' command
I want a script to do this. the problem is the prompt is changed , but the command s not getting executed. my script luks like this.

#! /bin/csh -f
XYZ
sleep 15
stop-process
exit

how to do tht?
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 09:25 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