|
|
10.6: Format text via a Service and emacs
Additionally...
...would probably be cleaner via mktemp (1), and for this:
cat (1) reads stdin by default, so 'cat /dev/stdin' is redundant, though tr (1) also reads stdin by default, so the 'cat' is not actually needed (though if your system has it, 'mac2unix' may also be a slightly clearer way of achieving the same thing as that particular invocation of tr). In combination with fmt (1) as mentioned above, there should actually be no need for temporary file at all, obviating the 'mktemp' as well, and the script basically becomes a one-liner, perhaps just piping mac2unix into fmt (and maybe back into unix2mac again if you want carriage returns instead of line feeds).I think the more fundamental hint here though is the mechanism of having text-manipulation scripts available as a service (and as mentioned, possibly with a quick hotkey) which is a cool idea that could allow lots of similarly-handy things. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.07 seconds |
|