Taking inputs on prompt


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Taking inputs on prompt
# 1  
Taking inputs on prompt

need a help to get a script:
Code:
bash # ./xx.sh
>> count
567


script will run the xx.sh and it will go to >> then run "count"
will get the result "567" and print it

Last edited by radoulov; 05-09-2013 at 07:23 AM..
# 2  
Quote:
Originally Posted by Aditya.Gurgaon
need a help to get a script:

bash # ./xx.sh
>> count
567


script will run the xx.sh and it will go to >> then run "count"
will get the result "567" and print it
There may be a language barrier here, but I have no idea what you are trying to do.

Please use CODE tags!

If you just want to print the result "567", one way to do it is:
Code:
echo 567

The script that you provided:
Code:
bash # ./xx.sh
>> count
567

will start an interactive bash shell.
When you exit that shell, it will create a file named count if it didn't already exist.
Then it will try to run a command named 567.
# 3  
no no.ok i am expaling again.....

i want when >> will come script will print "count "
# 4  
When exactly >> will come? Smilie
# 5  
after running xx.sh .this is my prompt sign >>
# 6  
Finally... what does xx.sh contains?
# 7  
it is just a script ........

---------- Post updated at 02:34 AM ---------- Previous update was at 02:32 AM ----------

if i will run dis then it will gv >> , then i have run some coomand.....which will gv some value .i want to print that value..........\
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #302
Difficulty: Easy
The GNU website is the official repository for Slackware.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inputs argument for sh -c

I have doubts with the following command: % find "$1" -name "*.html" -print0 | sort -zn | xargs -r -0 -n 1 sh -c 'echo "Dumping file: $2" >> "$1"; w3m "$2" >> "$1" 2>&1 ' sh "$2" I have doubts in the input arguments value i.e. $0, $1, $2... Step by step: 1.- % find "$1" -name "*.html"... (10 Replies)
Discussion started by: puertas12
10 Replies

2. Shell Programming and Scripting

Taking inputs for awk

Hi, i want to print 2nd column value with the below script. I need to take input of the string i need to search in that file and file name. How can i take these two as inputs? using read command? Getting error for below script. echo "enter SID" read SID echo "enter filename" read filename... (8 Replies)
Discussion started by: sam_bd
8 Replies

3. Solaris

Unable to move from rsc prompt to ok prompt

Hi, on sunfire v890 unable to move from rsc prompt to ok prompt, i have executed the command break. (9 Replies)
Discussion started by: manoj.solaris
9 Replies

4. UNIX for Dummies Questions & Answers

How to Change the % prompt to - prompt in UNIX?

how to Change the % prompt to - prompt in unix :wall: ---------- Post updated at 07:40 AM ---------- Previous update was at 07:38 AM ---------- How To display the last modification time of any file in unix ---------- Post updated at 07:40 AM ---------- Previous update was at 07:40 AM... (2 Replies)
Discussion started by: manjiri sawant
2 Replies

5. Shell Programming and Scripting

Perl script for taking inputs from one script and storing them into a document.

Hi. I wanted to create a Perl script which can take the outputs of a Perl script as it's input and temporarily store them in a document. Need help. Thanks.:) (8 Replies)
Discussion started by: xtatic
8 Replies

6. Shell Programming and Scripting

Backup code with two inputs

Hi how can i backup files setrain size Thanks (1 Reply)
Discussion started by: lio123
1 Replies

7. Shell Programming and Scripting

Check for numeric inputs

Hi All, How do i modify the below script such that if the input is numeric, it will give the numeric digit, else it will ouput "0" echo "xxx" | awk '/^+$/' (6 Replies)
Discussion started by: Raynon
6 Replies

8. Shell Programming and Scripting

Please give your inputs !!!!

I am trying to extract two fields from the output of ifconfig command on one of my sun server . The output looks like : root@e08k18:/tmp/test# ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 ce0:... (9 Replies)
Discussion started by: kpatel786
9 Replies

9. Shell Programming and Scripting

Inputs from a file

Hi, I have a shell script that has to taken inputs from a file say "Inputs". Now I take 2 inputs at a time. Suppose the Inputs file contains numbers like 2 3 4 5 Now I have a written a script for adding 2 numbers. When I run the script for first time 2 and 3 must be the inputs. When i run the... (4 Replies)
Discussion started by: sendhil
4 Replies

10. Shell Programming and Scripting

Multiple Inputs

Have tried the search, but nothing resembles what I'd like to accomplish. I am attempting to write a script that will allow the user to input a list of data at the command prompt, then the data is used by another script for processing. I am allowing the user a list of 10 members in order to... (4 Replies)
Discussion started by: douknownam
4 Replies

Featured Tech Videos