working in different prompts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting working in different prompts
# 1  
Old 08-30-2007
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  
Old 08-30-2007
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  
Old 08-30-2007
Quote:
Originally Posted by gopsman
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  
Old 08-30-2007
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?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Provide 2 inputs when prompts

Hi All, I am a novice to UNIX, i need to know is there a way to provide 2 inputs when the shell prompts and i need to assign those 2 values to 2 separate variables. I dont want to give those values as a arguments (while running the script). Thanks in advance!! (1 Reply)
Discussion started by: prasanna2166
1 Replies

2. Shell Programming and Scripting

Expect scripting not seeing the screen prompts.

Someone recommended using an expect script for an issue I was having so I tried writing one but of the 3 expected prompts on the screen, it only see responds to the first one. The code is: ==================================== #!/usr/local/bin/expect -f spawn /usr/local/bin/rcs -u1.1 xyz.fmb... (1 Reply)
Discussion started by: pjones006
1 Replies

3. AIX

Deleting a file prompts for a Yes or No

Hi.. I have been asked to delete files in a certain directory in our AIX server, but the problem is, there are over 1000 files to delete. I am prompted by a yes (y) or a no (n) each time and i don't wanna type in a 'y' a thousand times.. :-( Is there a command that i can use to make things faster?... (1 Reply)
Discussion started by: chipahoys
1 Replies

4. Shell Programming and Scripting

Shell Program that prompts for user Id

Hi I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (16 Replies)
Discussion started by: mmg2711
16 Replies

5. UNIX for Dummies Questions & Answers

Shell Program that prompts for user Id

Hi I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (1 Reply)
Discussion started by: mmg2711
1 Replies

6. Shell Programming and Scripting

Shell script answer prompts?

Hi, I'm writing a script that calls a function to generate a certificate. In generating this certificate, I'm asked a series of questions. I was wondering, is there a way to pre-program my script to answer these questions in the same way all the time. I saw something like EOF>> y EOF ... (4 Replies)
Discussion started by: eltinator
4 Replies

7. UNIX for Advanced & Expert Users

password prompts

I would like to log all the commands that are entered on an ssh client. I can do this successfully, however, I dont want to log user logins and passwords. Is there any way to identify passwords and avoid them? For example, I can look for a string 'password:' and ignore everything until a nl/cr. Is... (2 Replies)
Discussion started by: balag
2 Replies

8. Shell Programming and Scripting

scripting password prompts

Hi there Probably a really simple question but I am writing an install script and at certain stages of the install (ie creating a table in mysql) the system prompts for you to enter a password, I was wondering, how do I script this input so that the install doesnt keep stopping for manual... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

9. Shell Programming and Scripting

rsh help with remote prompts

Hi, I'm writing a shell script that rsh's onto a remote machine and runs a perl script that requires values to be entered as the script executes. I also need to ba able to see the outputs from the perl script. When I try to run it I get an stty : Invalid argument and understand that this is... (4 Replies)
Discussion started by: ianf
4 Replies

10. Shell Programming and Scripting

Tough question - interactive prompts

I have inherited a script (ksh) - which requires an input file and location to be specified on the command line..... i.e runsc MRG_060601 ../input_files/ I am trying to tidy this up by using an env variable for the location (as it is always the same) - but it will still require the name of... (2 Replies)
Discussion started by: peter.herlihy
2 Replies
Login or Register to Ask a Question