unix - Executing a shell script with code accepted using I/O indirection -


i trying execute script this, accepting script using indirection

sh <<eot str in `cat test`  echo $str done eot 

the file "test" has contents

a b c 

it gives below error.

sh: line 2: syntax error near unexpected token `b' sh: line 2: `b' 

can clarify ?. aim execute script above instead of creating shell script file script.sh , executing (which works fine)

your outer shell interpolating heredoc. prevent that, quote delimiter:

sh << 'eot' 

to clarify, have equivalent to:

sh <<eot str in b c  echo done eot 

which makes syntax error obvious.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -