Skip to content

Instantly share code, notes, and snippets.

@srbmiy
Created March 9, 2015 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srbmiy/a19d9e92403fee2bf506 to your computer and use it in GitHub Desktop.
Save srbmiy/a19d9e92403fee2bf506 to your computer and use it in GitHub Desktop.
#!/bin/sh
#export WORKDIR=/cygdrive/c/Users/tmiy/Desktop
#export RE="<a href=\".*\""
#export FILTERED=./testdata.txt
## main ##
cd /cygdrive/c/Users/tmiy/Desktop/Apple_files ##
grep -irho "<a href=\".*\"" ./ > ../testdata.txt ##
sed -e "s/\"//g" ../testdata.txt | sed -e "s/<A HREF=//g" > ../testdata2.txt ##
##cat ../testdata.txt ##
##cat ../testdata2.txt ##
cat ../testdata2.txt | while read line; do if [[ -f "../${line}" ]]; then echo ok; else echo No such file : "../${line}"; fi; done ##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment