Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Homegrown solution' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Homegrown solution
Authored by: thevas on Oct 08, '02 03:34:38PM
You can get the same effect with
sed -e 's/.*/say "&"/' | osascript
Or, just make a tcsh alias:
alias say 'sed -e 's/.*/say "&"/' | osascript'
Note: You'll need a backslash before each quote except the outermost ones. I can't figure out how to make that display! Now 'cat foo.txt | say' speaks out the file foo, and 'uptime | cut -d' ' -f3-7 | say' speaks out your uptime, etc.

[ Reply to This | # ]
Homegrown solution
Authored by: tfriesen on Oct 10, '02 12:01:55AM

Quoting this is non-trivial for those folks who don't live and breathe regular expressions.

It should read:
alias say 'sed -e '\\''s/.*/say '\\\\\\"'&'\\\\\\"'/'\\'' | osascript'

Honest!

Cheers,
Tom Friesen



[ Reply to This | # ]
Homegrown solution
Authored by: tfriesen on Oct 10, '02 12:07:05AM

Uh oh. Preview wasn't totally honest with me on that last one. Each double backslash in the previous post should only be a single backslash.

As in...
alias say 'sed -e '\''s/.*/say '\\\"'&'\\\"'/'\'' | osascript'

Mea culpa.

Tom Friesen



[ Reply to This | # ]
Homegrown solution
Authored by: thevas on Oct 10, '02 12:41:01AM
Or, you can just make tcsh quote things more "normally" with
set backslash_quote. Then you need just one backslash per inner quote.

[ Reply to This | # ]