[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stacking arguments in a Unix executable!
Ariel,
I believe the question was - "how do you feed predefined
values into a script or program at run-time without typing them
in at run-time?"
The way I would do this is - assuming the program is
called myscript, and assuming it asks for a single numeric value
at every invokation, and assuming that the value will be 25
every time - do this:
# run-myscript
#!/usr/bin/sh
echo "25" | myscript
Then just run "run-myscript" from the command line. Couldn't be
simpler. You could also use environmental variables, etc.
Brian.
>>>>> "Ariel" == Ariel Mazzarelli <mazzare@primenet.com> writes:
>> Hi Jerry,
>>
>> I don't know if this is the 'official' way to do it, but you can
>> do it this way:
>>
>> $ echo "25" | <shell-script>
Ariel> Hmmm, I'm not sure that's what Jerry wanted.
Ariel> $ echo "25" 25 $ echo "25" | echo
Ariel> $ echo < echo "25" 25 $ echo "25" > echo $
Ariel> Ariel
--
---------------
Brian L. Sellden - brian@henge.com, brians@usa.net
User of Emacspeak 6.0, making Unix talk.
http://www.henge.com/~brian
What on earth would a man do with himself if something did not stand in his way?
-- H.G. Wells
---
Send your message for blinux-list to blinux-list@redhat.com
Blinux software archive at ftp://leb.net/pub/blinux
Blinux web page at http://leb.net/blinux
To unsubscribe send mail to blinux-list-request@redhat.com
with subject line: unsubscribe