|
|
An alias that uses perl
Rather than loading a file into a text editor (like emacs or BBEdit), I have an alias set up that does the conversion, using perl instead:
And then I can use it directly from the command line:
An alias that uses perl
Somebody else suggested that a drag-and-drop tool would be useful. Here's a quick AppleScript droplet that accepts files dropped onto it (ignoring directories) and then passes the absolute path of each file to a one-line perl script.
on open fileList
repeat with x in fileList
if folder of (info for x) is not true then
set y to POSIX path of x
do shell script ("perl -pi -e \"tr/\\015/\\12/\" " & y)
end if
end repeat
end open
An alias that uses perl
can I use Logan's "alias mac2unix="perl -p0015l0012e '' -i $*"" with this script
An alias that uses perl
You might be missing a space between the '-i' and the path to the file.
An alias that uses perl
Yeesh. A one-liner?
How about a zero-character script that does the same thing? ;)
alias mac2unix="perl -p0015l0012e '' -i $*"
An alias that uses perl
I like yours better — there's less time wasted compiling that 'tr' operation. TMTOWTDI, in any case.
An alias that uses perl
re: alias mac2unix="perl -p0015l0012e '' -i $*"
An alias that uses perl
That's an l (lower case "L"), not a "|" pipe. See what a difference that makes to your script. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks 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 |
|