[Gllug] Bash Scripting
tet at accucard.com
tet at accucard.com
Fri May 24 13:58:44 UTC 2002
>#!/bin/sh
>blocks=$(mkisofs -J -r -quiet -print-size $@)
>mkisofs -J -r $@ | cdrecord -dao -tsize=$cdblockss -
>
>./cdwrite.sh File\ With\ A\ Space Another\ File
>
>Complains that File doesn't exist...can't seem to get the quoting to
>work. I've tried '$@' and "$@"
>
>It's bound to be simple but I'm foxed.
Yep, it is simple, and you've even mentioned the solution yourself.
Just enclose both occurrences of $@ in double quotes. You also need
to enclose the blocks variable in {} to ensure the final "s" doesn't
get interpreted as part of the variable name:
#!/bin/sh
blocks=$(mkisofs -J -r -quiet -print-size "$@")
mkisofs -J -r "$@" | cdrecord -dao -tsize="${blocks}s" -
Tet
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list