Re: Shell-wrap a file in 2 variable strings
Re: Shell-wrap a file in 2 variable strings
- Subject: Re: Shell-wrap a file in 2 variable strings
- From: Gnarlodious <email@hidden>
- Date: Sun, 01 Feb 2004 11:04:00 -0700
Entity Chris Janton spoke thus:
>
echo "TAG-OPEN" `cat somefile` "TAG-CLOSE" > some-file
Thanks, Chris, the trick, it seems, is to wrap the command in slanty quotes
(wonder why?):
do shell script "echo " & quoted form of startHTML & " " & "`cat " &
flopPOSIX & "`" & " " & quoted form of endHTML & ">>" & iPathPOSIX
Or am I doing this the hard way?
This command works:
"<html>" `cat flip.txt` "</html>" > testFile.txt
note that it uses slanty quotes, "`" (ASCII 96).
But these simply wrap the command and filepath in the tags:
echo "<html>" cat flip.txt "</html>" > testFile.txt
echo "<html>" 'cat flip.txt' "</html>" > testFile.txt
like this:
<html> cat flip.txt </html>
So it's possible to say that Terminal ignores straight quotes (ASCII 39).
Guess I just don't grasp the concept, unless it's only a shortcut to escape
Applescript characters..
-- Gnarlie
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.