<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<br><br>> Date: Thu, 9 Jun 2011 21:05:45 -0700<br>> From: steve.langasek@ubuntu.com<br>> To: grail69@hotmail.com<br>> CC: upstart-devel@lists.ubuntu.com<br>> Subject: Re: Process substitution into loop<br>> <br>> On Fri, Jun 10, 2011 at 03:53:15AM +0000, Grail Dane wrote:<br>> > Just wondering, as I can't find by googling, if it is at all possible to<br>> > do a processsubstitution into a while loop within an upstart script?<br>> <br>> > Example:<br>> > while read -r DEVICE<br>> > do<br>> >    ip link set dev $DEVICE up<br>> > done< <(ip link | awk '/^[0-9]/ && !/UP/ && gsub(/:/,""){print $2})<br>> <br>> > When issuing the start command on the script I get:<br>> > /proc/self/fd/10: line 6: syntax error near unexpected '<'init:<br>> > network-interfaces main process (1367) terminated with status 2start: Job<br>> > failed to start Would appreciated if someone would identify if i have done<br>> > something wrong or if this not a supported feature?<br>> <br>> The <() syntax is not part of the POSIX standard, it's a bash extension.<br>> Upstart uses /bin/sh to interpret scripts, as is customary; chances are<br>> you're running on a system where /bin/sh is not bash, and as a result this<div><br></div><div>Actually /bin/sh is a symbolic link to bash on my system.  Is there anyway to have bash as the</div><div>shell used?</div><div><br></div><div>> syntax is not supported.<br>> <br>> A supported syntax would be:<br>> <br>>   ip link | awk '/^[0-9]/ && !/UP/ && gsub(/:/,""){print $2}' |<br>>   while read -r DEVICE<br>>   do<br>>       ip link set dev $DEVICE up<br>>   done<br>> <br>> -- <br>> Steve Langasek                   Give me a lever long enough and a Free OS<br>> Debian Developer                   to set it on, and I can move the world.<br>> Ubuntu Developer                                    http://www.debian.org/<br>> slangasek@ubuntu.com                                     vorlon@debian.org<br></div>                                    </body>
</html>