11-07-2001
Hi
Inside a shell script you can read the arguments passed to your shell program by $1, $2, $3 .......
for e.g if your script file name is myscript and if you want to pass an argument to it like (myscript arg1) then inside myscript you can refer the arg1 by $1.
Hope this helps
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I was able to pass parameters to a shell script from the command line but now, I am trying to make the shell script to get those parameters/values from a file.
Please give me ideas how to do this or if you have an example or website that shows how to do this.
I tried searches but it... (2 Replies)
Discussion started by: bryan
2 Replies
2. UNIX for Dummies Questions & Answers
Can anyone help me how to write a shell script which accepts input parameter. My requirement is as follows:
I need to run a shell script with a input parameter, and inside the script i will create a file with this input parameter name.
Please help me out to create such a shell script.
... (1 Reply)
Discussion started by: jhmr7
1 Replies
3. Shell Programming and Scripting
Dear Friends,
Please help me.
How can I pass a parameter from one Shell-script to another Shell-script.
Example:
FirstScript.sh
-------------
./SecondScript.sh 'paramater'
And
SecondScript.sh
---------------
doing something with passed parameter from FirstScript.sh
Please... (2 Replies)
Discussion started by: subodhbansal
2 Replies
4. Shell Programming and Scripting
I have a script file as below named test1.sh
sed -e 's/xxxkeys/$1/g' template1.asp > template1.txt
sed -e 's/xxxkeys/$2/g' template2.asp > template2.txt
sed -e 's/xxxkeys/$3/g' template3.asp > template3.txt
sed -e 's/xxxkeys/$4/g' template4.asp > template4.txt
I want to replace $1 with a,... (1 Reply)
Discussion started by: satgur
1 Replies
5. Shell Programming and Scripting
Hi All
I have a shell script which calls all the Teradata Utiltyes . There is a sudden change in the requirment .
What i'm asked to do is
pass on the DATE to the shell script which should take the date automatically and run the utilityes.
i.e. the date should not be passed on... (5 Replies)
Discussion started by: vinayrao
5 Replies
6. AIX
I would like to run a compress script on files in certain directories.
My compress_script.sh is just basically
compress file*
In order for me to use this I have to copy it into each directory and run it.
How can I state the directory on the command line with the compress script so it... (2 Replies)
Discussion started by: NycUnxer
2 Replies
7. Shell Programming and Scripting
How can i chnage the parameter value in shell script.
file name is icare_mmi_cls.com, inside that the parameter name is 10.100.1.2" replace the address to bep-sftp.cce.com.
can you please provide me with examples.
Thanks
Double post - check your PMs and follow the rules, thanks. (0 Replies)
Discussion started by: damodarreddys
0 Replies
8. UNIX for Dummies Questions & Answers
How can i chnage the parameter value in shell script.
file name is icare_mmi_cls.com, iside that the parameter name is 10.100.1.2" replace the address to bep-sftp.cce.com.
can you please provide me with examples.
Thanks. (3 Replies)
Discussion started by: damodarreddys
3 Replies
9. Shell Programming and Scripting
Hi
I have two shell script, the second script takes as a parameter the output variable of the first script, please how to retrieve the variable from the first script to pass as a parameter to the second script?
Script1.sh
i=0
i=$(($i + 1))
Script2.sh
echo $1
Thank you (0 Replies)
Discussion started by: chercheur111
0 Replies
10. Shell Programming and Scripting
Hi All,
I need urgent Help from all of you here.
Below is my code-
==================================================
#!/usr/bin/sh
cd $1
cat $2 | tr -ds "$" "" > parameter_file.param
export `parameter_file.param`
chmod 777 parameter_file.param
echo $1
echo $2
cd $prmDirInput... (5 Replies)
Discussion started by: Amit786
5 Replies
LEARN ABOUT DEBIAN
amqp-consume
AMQP-CONSUME(1) RabbitMQ C Client AMQP-CONSUME(1)
NAME
amqp-consume - Consume messages from a queue on an AMQP server
SYNOPSIS
amqp-consume [OPTION...] {command} [args...]
DESCRIPTION
amqp-consume consumes messages from a queue on an AMQP server. For each message that arrives, a receiving command is run, with the message
body supplied to it on standard input.
amqp-consume can consume from an existing queue, or it can create a new queue. It can optionally bind the queue to an existing exchange.
By default, messages will be consumed with explicit acknowledgements. A message will only be acknowledged if the receiving command exits
successfully (i.e. with an exit code of zero). The AMQP "no ack" mode (a.k.a. auto-ack mode) can be enable with the -A option.
OPTIONS
-q, --queue=queue name
The name of the queue to consume messages from.
If the --queue option is omitted, the AMQP server will assign a unique name to the queue, and that server-assigned name will be
dixsplayed on stderr; this case implies that an exclusive queue should be declared.
-e, --exchange=exchange name
Specifies that an exclusive queue should be declared, and bound to the given exchange. The specified exchange should already exist
unless the --exchange-type option is used to request the creation of an exchange.
-r, --routing-key=routing key
The routing key for binding. If omitted, an empty routing key is assumed.
-d, --declare
Forces an exclusive queue to be declared, even when it otherwise would not be. That is, when a queue name is specified with the --queue
option, but no binding to an exchange is requested with the --exchange option.
-A, --no-ack=routing key
Enable "no ack" mode: The AMQP server will unconditionally acknowledge each message that is delivered, regardless of whether the target
command exits successfully or not.
EXAMPLES
Consume messages from an existing queue "myqueue", and output the message bodies on standard output via cat:
$ amqp-publish -q myqueue cat
Bind a new exclusive queue to an exchange "myexch", and send each message body to the script myscript, automatically acknowledging them on
the server:
$ amqp-consume -A -e myexch ./myscript
SEE ALSO
librabbitmq-tools(7) describes connection-related options common to all the RabbitMQ C Client tools.
AUTHOR
The RabbitMQ Team <info@rabbitmq.com>
RabbitMQ C Client 2011-01-01 AMQP-CONSUME(1)