Interaction shell cmd prompt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Interaction shell cmd prompt
# 1  
Old 12-31-2008
Interaction shell cmd prompt

hi ,

how do i interact with the shell prompt.
i need no. of args to be dynamic

e.g
$> type the no of args: <input from keyboard>
Enter the 1 st arg : <input from keyboard>
Enter the 2nd arg : <input from keyboard>
.........
.........

let me know how to do it ...
# 2  
Old 12-31-2008
Code:
a=0
last="default"
while [ $last != "" ]; do 
    echo -n "Enter arg $a:" 
    read last
    eval set \$arg$a=$last
done

Now your arguments are $arg1 $arg2 $arg3 and so on.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to use reset_server (siebel server) cmd in shell script

hello frnds, im using a script to stop, reset and to start the siebel server.. i'm able to extract the enterprise name, siebel server name and siebel root path.. when i try to use these info in the script im unable to perform the reset_server -r <siebel root> -e <enterprise name> +-M... (3 Replies)
Discussion started by: kaushik_87
3 Replies

2. Shell Programming and Scripting

Use Unix shell script to open Windows command prompt (cmd)

Hello, I work on Windows and I use Putty to access a remote UNIX server. I am trying to build a shell script that will have as main task to open the Windows command prompt (cmd) and run some Windows commands thereafter. The commands are actually file transfer commands that will download a file... (14 Replies)
Discussion started by: rookie2785
14 Replies

3. Shell Programming and Scripting

how to change unix cmd display prompt?

I am new to to unix and I want to make my own basic shell. What is the code I can use to change the unix cmd console display? For example my unix display prompt says MyCompterName~, I want it to say WhatEverMan~ (3 Replies)
Discussion started by: megaearth77
3 Replies

4. Windows & DOS: Issues & Discussions

script to open new cmd prompt for devices on visio

Hello, Can any one please help: I have a lab design on Visio, with routers and switches. What I am planning to do is: when I double click a device icon - it should open a new cmd prompt window and automatically performs the telnet session and log's me into the device. Appreciate your... (0 Replies)
Discussion started by: sureshcisco
0 Replies

5. Shell Programming and Scripting

Unix cmd prompt how to get old cmd run?

Hi, I am using SunOS I want to serch my previous command from unix prompt (like on AIX we can search by ESC -k) how to get in SunOs urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies

6. Shell Programming and Scripting

open terminal to run cmd using shell script

i want the shell script to open the terminal and in that terminal i want to run a command specified in the script... how can it be done... (2 Replies)
Discussion started by: chandrabhushan
2 Replies

7. Shell Programming and Scripting

how2 shell cmd into variable

How do I place the result of a shell command into a variable. I would like to save the pwd in $DIR. I tried... pwd | $DIR $DIR < pwd DIR=pwd thanks! jz (2 Replies)
Discussion started by: jwzumwalt
2 Replies

8. HP-UX

Nohup shell with REMSH cmd => SIGTTIN

Hi, I have a shell with 2 remsh commands I run my job with the following command nohup job1 >log1 2>log2 & The job 1 has 2 remsh commands: remsh host1 -l oracle /l1/oracle/script/test_remsh.sh remsh host1 -l oracle /l1/oracle/script/test_remsh2.sh I receive SIGTTN signal And 2 process stay... (2 Replies)
Discussion started by: brandouy
2 Replies

9. Shell Programming and Scripting

telnet shell script on red hat 9 cmd line only

i would like to make a shell script (red hat 9 cmd line only) to telnet to my local isp's webmail server on port 25 and send it commands such as helo :) help would be much appreciated, and i found no posts similar that answered my question... the closest i've gotten to an answer from about 8... (3 Replies)
Discussion started by: kypeswith
3 Replies

10. Windows & DOS: Issues & Discussions

rediretion and pipes in DOS shell cmd interpreter

Hello, I am trying to accomplish the following. Send the output of a command to the screen (this happens by default) as well as capture the output of the screen to a log file. How can this be achieved in DOS command interpreter syntax. Any ideas/suggesstions/indicators are greatly... (2 Replies)
Discussion started by: jerardfjay
2 Replies
Login or Register to Ask a Question