Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/bash
- # ./get-dell-elements.sh
- # Israel Torres 20110307
- # Dell multiple hooks at one time with one file
- dellurl='http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details?c=us&cs=04&l=en&s=hied&ServiceTag='
- tempfile=$(date +%s)
- filter1="System Type:"
- filter2="Ship Date:"
- for SN in $(cat dell.txt)
- do
- #echo -ne "$SN\t"
- curl -s $dellurl$SN | tr "\"" "\n" > $tempfile
- DellSysType=$(cat $tempfile | grep "$filter1" -A 4 | grep '</td></tr><tr><td class=' | sed 's/<\/td><\/tr><tr><td class=//g' | sed 's/>//g')
- DellShpDate=$(cat $tempfile | grep "$filter2" -A 4 | grep '</td></tr><tr><td class=' | sed 's/<\/td><\/tr><tr><td class=//g' | sed 's/>//g')
- echo -e "$SN\t$DellSysType\t$DellShpDate"
- done
- rm -f tempfile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement