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: Andreas Schwab
Subject: Re: exec status with no command is 0 but no redirection
Date: Fri, 14 May 2010 21:31:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

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