Advertisement
IsraelTorres

extracturl.sh

Oct 26th, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/bash
  2. :<<israeltorres_comment_block
  3.  
  4.  ./extracturl.sh
  5.  Israel Torres
  6.  -20121026
  7.  -extracts url from .webloc file
  8.  
  9. Mac OS X 10.8.2 12C60
  10. Darwin Kernel Version 12.2.0
  11. GNU bash, version 3.2.48(1)-release
  12.  
  13. israeltorres_comment_block
  14.  
  15. #required app check
  16. rqdapp='DeRez'
  17. hash $rqdapp 2>&- || { echo >&2 "$rqdapp binary not found - aborting"; exit 1; }
  18. #
  19.  
  20. if [ ! $# -ne 1 ]; then
  21.     targetfile=$1
  22.     DeRez -e -only 'url ' "$targetfile" | grep '\/\* .* \*\/' | sed 's/^.*\/\* //;s/ \*\/$//' | tr -d '\n'
  23. else
  24.     echo "usage: $0 'string'"
  25.     echo "example: $0 string"
  26. fi
  27. #eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement