Re: Bash scripting question
From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: 11/29/04
- Previous message: Wiseguy: "Re: Bash scripting question"
- In reply to: Wiseguy: "Re: Bash scripting question"
- Next in thread: Lord Williams: "Re: Bash scripting question"
- Reply: Lord Williams: "Re: Bash scripting question"
- Reply: Wiseguy: "Re: Bash scripting question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Nov 2004 00:33:57 GMT
On Sun, 28 Nov 2004 at 23:20 GMT, Wiseguy wrote:
> Wiseguy <noone@all.com> mumbled in
> news:Xns95AF6CE44161Enooneallcom@216.65.98.75:
>
>> "Lord Williams" <lordwill@quik.com> mumbled in
>> news:pan.2004.11.28.08.09.47.347137@quik.com:
>>
>>> I am reading :
>>>
>>> Mendel Coopers : Advanced Bash - Scripting Guide:
>>> An in-depth guide exploration of the art of shell scripting
>>>
>>> I was refered to this guide by someone here... and I am enjoying it
>>> ....
>>>
>>> anyways
>>>
>>> what do I do if I need to save the result of a return
>>> value from my compiled C programs from the return or exit function,
>>> for later uses in my script file?
>>>
>>> Is there a example that I could find in the guide?
>> cat input | grep "hello" > /dev/null
>> $rv=$?
>> # just saved the grep return value in $rv
>
> oops...
>
> rv=$?
>
> putting $ in front of the lvalue is a perl thing
And putting "cat FILENAME |" in front of grep is a UUOC thing. :)
grep "hello" FILENAME > /dev/null 2>&1
rv=$?
-- Chris F.A. Johnson http://cfaj.freeshell.org ================================================================= Everything in moderation -- including moderation
- Previous message: Wiseguy: "Re: Bash scripting question"
- In reply to: Wiseguy: "Re: Bash scripting question"
- Next in thread: Lord Williams: "Re: Bash scripting question"
- Reply: Lord Williams: "Re: Bash scripting question"
- Reply: Wiseguy: "Re: Bash scripting question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]