bash - read: Illegal option -d -


here offending part of script:

read -d '' text <<'eof' multiline text in   var eof  echo "$text" > ~/some/file.txt 

and error:

read: 175: illegal option -d 

i use read -d on place , works fine. not sure why not happy now. i'm running script on ubuntu 10.10

fixes? workarounds?

if run sh , try command, get:

read: 1: illegal option -d 

if while still in bash, works fine.

i therefore deduce script not running under bash.

make sure script begins line:

#!/usr/bin/env bash 

(or equivalent) correct shell running script.

alternatively, if cannot (because script not bash one), aware -d bash feature , may not available in other shells. in case, need find way.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -