• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shell-wrap a file in 2 variable strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Shell-wrap a file in 2 variable strings
      • From: Axel Luttgens <email@hidden>
References: 
 >Re: Shell-sandwich a file in 2 variable strings (From: Chris Janton <email@hidden>)

  • Prev by Date: Re: Shell-sandwich a file in 2 variable strings
  • Next by Date: Re: Shell-wrap a file in 2 variable strings
  • Previous by thread: Re: Shell-sandwich a file in 2 variable strings
  • Next by thread: Re: Shell-wrap a file in 2 variable strings
  • Index(es):
    • Date
    • Thread