f



std output and std error

Hi ,

I have a line in script as below.

METHODRES="$(ls -1 ${L_ROLLBACK_DIR}/${L_ROLLBACK_FILE}* 2>&1)"

i  think if file is present in above case the value of METHODRES  will
be 0.
wat is the significance of (2>&1) i do not understand much.
I think it will output std err to std output by this (2>&1) .
I am not sure  what will the value of  METHODRES in error cases.

Will any one clear my doubts .

Thanks in Advance !!!


Regards
Aki
0
aki
5/7/2009 9:53:15 AM
comp.unix.shell 15484 articles. 3 followers. Post Follow

1 Replies
610 Views

Similar Articles

[PageSpeed] 1

On 2009-05-07, aki <akhileshrawat007@gmail.com> wrote:
>
>
> Hi ,
>
> I have a line in script as below.
>
> METHODRES="$(ls -1 ${L_ROLLBACK_DIR}/${L_ROLLBACK_FILE}* 2>&1)"
>
> i  think if file is present in above case the value of METHODRES  will
> be 0.
No, it will be the output of the ls command.

> wat is the significance of (2>&1) i do not understand much.
> I think it will output std err to std output by this (2>&1) .
> I am not sure  what will the value of  METHODRES in error cases.
>
If an error occurs, METHODRES will contain the error message.

> Will any one clear my doubts .
>
> Thanks in Advance !!!
>
>
> Regards
> Aki

0
Bill
5/7/2009 12:42:42 PM
Reply: