• 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: Encrypting passwords with AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Encrypting passwords with AS


  • Subject: Re: Encrypting passwords with AS
  • From: Philip Aker <email@hidden>
  • Date: Fri, 07 Feb 2003 12:44:13 -0800

On Thursday, February 6, 2003, at 07:20 PM, Paul Skinner wrote:

man tr | tr "\n" "\r" > ~/Desktop/tr.txt

Can you pass that through do shell script?

Yes, but the form has to be changed slightly, But if I wanted to call it from AppleScript then I would do some more work in the shell call to have things come out nicer. Reason being that a 'man' call normally formats for the Terminal and that will embed some nasty control characters in the output. Here we pipe the complete man pages for an arbitrary item through 'col' to get rid of them and then use 'tr' to achieve the desired line endings:

on GetManPage(theCommandName)
set alf to (quoted form of (ASCII character 10))
set acr to (quoted form of (ASCII character 13))
set txt to do shell script "man -a " & theCommandName & " | col -bx"
do shell script "echo -n " & (quoted form of txt) & " | /usr/bin/tr " & alf & " " & acr
end GetManPage
GetManPage("ditto")



Philip Aker
http://www.aker.ca
_______________________________________________
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.

References: 
 >Re: Encrypting passwords with AS (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: Printing to PDF via GUI scripting
  • Next by Date: dealing with tex-edit plus F
  • Previous by thread: Re: Encrypting passwords with AS
  • Next by thread: Re: Scriptable notepad? (ditching Entourage)
  • Index(es):
    • Date
    • Thread