[ale] Bash script help

Todd Pike tpike at teepee-sw.com
Tue Aug 22 07:42:31 EDT 2006


Ah the pitfalls of quoting.  First thing is you need to escape the quotes
around your $(date) command so they stick around when you execute $MKCD
later.  If not then the space between the day of week (%a) and the date
(%F) will show only the DOW to -V.  Next thing is it appears that the pipe
symbol is outside the quotes so it gets "executed" rather than included 
in the assignment.  So what is the recipient of the pipeline?  The whole
string after so bash tries to find a command called (without quotes):
"cdrecord blank=fast....burnfree -"

Unless you named a shell script funny that doesn't exist. :-)

Try something like this:
MKCD="mkisofs -J -R -V \"$(date '+%a %F')\" \"$TDIR$IBALL\" | cdrecord
blank=fast driveropts=singlesession,burnfree -"

Notice I put a set of escaped quotes around $TDIR$IBALL in case you have a
directory with a space in it.

todd..


> Okay, I am trying to build my own backup script and running into an
> error trying to pipe mkisofs into cdrecord. I am getting a command not
> found on the cdrecord part. This is a bash script and the problem line
> is below.
>
> MKCD="mkisofs -J -R -V "$(date '+%a %F')" $TDIR$IBALL" | "cdrecord
> blank=fast driveropts=singlesession,burnfree -"
>
> The MKCD is being called as a variable in the script. I have not benn
> able to find out why the pipe fails. Ideas?
>
> TIA
> --
> Jim Seymour <bluejay at speedfactory.net>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale




More information about the Ale mailing list