On 11/30/06, Jay Louvion <email@hidden> wrote:
>
>
> Hi all, I'm trying to script a shell that includes variables as follows:
Sorry, I'm going to ask you to back up and clarify what you're trying
to do here.
> #!/bin/sh
> export
> PATH="/opt/darwinports/bin:/bin:/sbin:/usr/bin:/usr/sbin"
> id >> "$1/buildimage.log"
> date >> "$1/buildimage.log"
> rm -rf "$3"
> dvdauthor -o "$3" -x "$2" 2>> "$1/buildimage.log"
> mkisofs -dvd-video -o "$1/$5.iso" -volid "$5 DVD" "$3" "$4" 2>>
> "$1/buildimage.log"
> rm -rf "$3"
That's not a shell, that's a shell *script*. The "shell" is the
program that executes it (in this case, /bin/sh). So I don't know
what you're trying to do when you say you want to 'script" the above.
If you save those lines exactly as-is to a file somewhere, and turn on
execute permission on that file (via chmod +x /path/to/the/file), then
you can run it from AppleScript with something like this:
do shell script "/path/to/the/file " & quoted form of valueForDollar1
& " " & quoted form of valueForDollar2 & " " & quoted form of
valueForDollar3 & " " & quoted form of valueForDollar4
If your goal is to get the equivalent of running that shellscript
without having to store it in a file first, well, I'd recommend
translating the program to AppleScript using as few shell commands as
possible, and then run those with individual "do shell script"?