Re: Encrypting passwords with AS
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.