[clug] can't invoke ex from inside an if statement

Rousak, Boris Boris.Rousak at actewagl.com.au
Mon Nov 24 14:57:16 EST 2003

Greetings all,
I am stumped on this seemingly obvious problem so any hints/advice would be
very much appreciated. I wrote the following script using ex:

ex - myfile << EOF
/15:01:06/ | .= | d | a |Nov 14 15:01:06 /usr: 1

And it works fine, when run from the command line like so ./myscript
But when I add a simple if statement to the script:

if [[ 1 = 1 ]]; then
ex - myfile << EOF
/15:01:06/ | .= | d | a |Nov 14 15:01:06 /u20: 1

and run again I get the following error message:
./myscript[2]: syntax error at line 4 : `
where line 4 is the line invoking ex i.e. ex - myfile << EOF.
I've tested the if statement on its own and it works fine, so does anyone
have any ideas on what am I doing wrong here?


*PLEASE NOTE*  This email and any attachments may
be confidential. If received in error, please delete all 
copies and advise the sender. The reproduction or 
dissemination of this email or its attachments is 
prohibited without the consent of the sender.

WARNING RE VIRUSES:  Our computer systems sweep
outgoing email to guard against viruses, but no warranty 
is given that this email or its attachments are virus free. 
Before opening or using attachments, please check for 
viruses.  Our liability is limited to the re-supply of any 
affected attachments.

Any views expressed in this message are those of the 
individual sender, except where the sender expressly,
and with authority, states them to be the views of the 

More information about the linux mailing list