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: Chris Janton <email@hidden>
- Date: Mon, 02 Feb 2004 05:01:30 -0700
On Feb 1, 2004, at 8:44 PM, Gnarlodious <email@hidden>
wrote:
This command works:
"<html>" `cat flip.txt` "</html>" > testFile.txt
note that it uses slanty quotes, "`" (ASCII 96).
Yes, the "backquote" characters are important - they work differently
than single-quotes.
I had to go back and read the man page for the shell (see "Command
Substitution") to see what they actually call the backquote in the
documentation and found the equivalence (better for readability)
$(command)
or
`command`
followed by this little note
The command substitution $(cat file) can be replaced by the equivalent
but faster $(< file).
so - for speediness use $(< file) in the middle of your echo.
and go have a read of the shell manual - "man sh" - it's fascinating
what you can do once you've decided that "do shell script" is part of
the solution set.
On my TiBook the character is an unshifted tilde - top left next to the
1 key
8)
----------------------------------
Chris Janton - face at CentosPrime dot COM
Netminder for Opus1.COM
_______________________________________________
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.