do shell script, redirected piped and backgrounded
do shell script, redirected piped and backgrounded
- Subject: do shell script, redirected piped and backgrounded
- From: Harald E Brandt <email@hidden>
- Date: Sat, 6 Dec 2003 15:59:38 +0100
The Technical Note 2065 excellently describes various aspect of the
use of do shell script, such as how to redirect standard error to
standard output and get it into a file and lastly putting it into
background:
do shell script "command > file_path 2>&1 &"
However, I would like to pass all output through a filter, such as
'tr' or 'perl', before it is written to file, AND that filter MUST
filter the output from BOTH standard output AND standard error. This
is more of a unix sh question than AppleScript, but nevertheless I
hope for an answer here. I have already looked into 'man sh', but it
is not clear about this combination. I would have expected the
following to work:
do shell script "command 2>&1 | tr '\\n' '\\r' > file_path &"
But no matter where I place the pipe or backgrounding '&' etc, it
won't do what I want to?
PS: Example of usage: curl, which outputs a mixture of CR and LF.
--heb
_______________________________________________
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.