Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: EXEC peculiarities
- X-seq: zsh-users 7850
- From: "Jay Guerette" <JayGuerette@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: EXEC peculiarities
- Date: Sun, 15 Aug 2004 13:24:56 -0400 (EDT)
- Importance: Normal
- In-reply-to: <912.411f8c59.a67bb@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <46981.217.160.254.91.1092582879.squirrel@xxxxxxxxxxxxxx> <912.411f8c59.a67bb@xxxxxxxxxxxxxxxxxxx>
>> I am a recent convert from Bash, and I'm confused about the behavior of
>> the 'exec' builtin. (zsh 4.2.0 on Linux)
>>
>> #! /bin/bash
>> EXEC='/sbin/ifconfig eth0'
>> exec $EXEC
>>
>> returns the expected output; the configuration of eth0
>>
>> #! /bin/zsh
>> EXEC='/sbin/ifconfig eth0'
>> exec $EXEC
>>
>> returns: "no such file or directory: /sbin/ifconfig eth0"
>
> The exec builtin has nothing to do with this.
>
> http://zsh.sunsite.dk/FAQ/zshfaq03.html#l17
Ok. So in the following examples, would the 1st form; ${(s: :)EXEC}; be
preferred, since the documentation says using the 2nd form; ${=EXEC};
forces SH_WORD_SPLIT on; potentially leading to unexpected behavior later?
#! /bin/zsh
EXEC='/sbin/ifconfig eth0'
EXEC=(${(s: :)EXEC})
exec $EXEC
#! /bin/zsh
EXEC='/sbin/ifconfig eth0'
EXEC=(${=EXEC})
exec $EXEC
Messages sorted by:
Reverse Date,
Date,
Thread,
Author