Advertisement
Masoko

Bash variables grep

Nov 28th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1. FILES=/home/pi/work/coty/orders/*.xml
  2. for f in $FILES
  3. do
  4.  
  5. grep -o -P '(?<=orderorder-no=").*?(?="><order-date)' $f | tr -d '\n'
  6. echo -n "    "
  7. grep -o -P '(?<=<country-code>).*?(?=</country-code)' $f | head -1 | tr -d '\n'
  8. echo -n "    "
  9. grep -o -P '(?<=<totals><merchandize-total><net-price>).*?(?=</tax>)' $f | cut -d '>' -f3 | head -1
  10.  
  11. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement