|
|
You guys are just great!
I love the shell, unfortunately I'll usually don't know about its features. Hints like these (the fact that webloc's save their data in resource forks and the fact that you can see this with cat /rsrc) make my day.
So I can now script a converter for synchronizing bookmarks between my mac, the pc and the solaris box. jipiiiee! Instead of many different commands (grep, tr, sed) I'd go for using as little as possible. one part of osteslag's version could be reduced to
Unfortunately I don't find clear "field boundaries" in the cat /rsrc-output, which I'd prefer so as not to be dependent on the Dev Tools (which are not on production machines...)
Any idea?
Works now without DeRez
Found it.
Gotta love shellscripts... Power in your hands...
Works now without DeRez
I've been using this:
strings site.webloc/rsrc | grep http | sed 's/^.//' | head -1
Works now without DeRez
That eats the 'h' from the 'http://....' leaving 'ttp://..'
Works now without DeRez
Why
drop it out and it ought to work better:
---
.webloc URL extraction
Did that to strip off the one random character prepended to "http://..." that 99% of my .webloc resource files have when I've run 'em thru strings and was too lazy to write the one-liner to handle the 1% exception that don't. I'll fix it later ...
.webloc URL extraction
First revision:
strings ${1}.webloc/rsrc | grep http | sed '/^.http/s//http/' | head -1 TODO: Generalize for non-http/https URL schemes. Optimize to eliminate grep and head. |
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.10 seconds |
|