On Sun, Nov 29, 2015 at 5:04 PM, Scott Mebberson <sc...@scottmebberson.com> wrote: > > Sorry for the noob question. But how can I pass the value to awk without it > complaining? > Hi Scott,
I'm pretty sure that your single quotes are confusing the execline parser. Since awk accepts either single or double quotes as delimiters, switching to double quotes should fix it. Your script also has a few issues that you'd have come across once fixing the awk issue. Try the following out instead: #!/command/execlineb -P s6-envdir -fn env importas -un HOSTNAME HOSTNAME backtick -in A { pipeline { getent hosts ${HOSTNAME} } awk "{print $1}" } import -u A ... Specifically, you need the -n option for importas, otherwise you'll end up sending a newline to awk and getting back a blank line. You can also swap out importas HOSTNAME HOSTNAME for import HOSTNAME but that's stylistic. All that said, you don't need to call awk in a pipeline to get your ip out of your environment. The following will do the same: #!/command/execlineb -P s6-envdir -fn env importas -un HOSTNAME HOSTNAME backtick -in A { /usr/bin/getent hosts ${HOSTNAME} } import -u A define -sn B ${A} ... define -sn B ${A} does essentially the same thing as awk '{print $1}'. You just need to bounce the value in and out of the environment a few times. Cheers! -- "If the doors of perception were cleansed every thing would appear to man as it is, infinite. For man has closed himself up, till he sees all things thru' narrow chinks of his cavern." -- William Blake