Advertisement
e55db081d05f58a

junk.sh

Jun 9th, 2019
5,655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. #! /bin/bash
  2. m=`cat /tmp/file.csv|cut -d "," -f2`;
  3. for m in `echo "$m"`;do
  4.     data=`cat /tmp/file.csv|grep "$m"`;
  5.     no=`echo $data|cut -d "," -f1`;
  6.     ma=`echo $data|cut -d "," -f2`;
  7.     gr=`echo $data|cut -d "," -f3`;
  8.     ca=`echo $data|cut -d "," -f4`;
  9.     tmp=`echo $gr|grep -Eio "[0-9]*$"`;
  10.     if [[ "$tmp" < 20 ]];then
  11.         tu="M";
  12.     else
  13.         tu="V";
  14.     fi
  15.     echo "$ma,$ca,$gr,$tu,$no";
  16. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement