bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exec status with no command is 0 but no redirection


From: fpo
Subject: Re: exec status with no command is 0 but no redirection
Date: Sat, 15 May 2010 14:06:48 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

Correct, my idea was to redirect the output of the whole script. The example used a sample 'echo' but it could instead produce dynamically some ISO-8859 encoded strings, due to some external constraints (ie. database). I thought it could be an easy way to do that in a single script. And your last comment makes it well. Thanks.

Regards,
- fpo


Le 14/05/2010 21:31, Andreas Schwab a écrit :
Bob Proulx<bob@proulx.com>  writes:

Beyond this I am not sure what you wanted to do with exec.  You may
have wanted this:

   exec iconv -f ISO_8859-1 -t UTF-8
I think he rather wants this:

exec>  >(iconv -f ISO_8859-1 -t UTF-8)

(See Process Substitution in the bash manual.)

Alternatively, enclose the whole script in { ... } and add the pipe
after that.

Andreas.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]