daily pastebin goal
87%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # This shell script is to tabulate and search for SR
  3. n=0 # Initial value for Sl.No
  4. next_n=$[$n+1]
  5. read -p "Enter your SR number : " SR
  6. echo -e "$next_nt$SRt$(date)" >> /tmp/cases.txt
  7.    
  8. 1  123   <date>
  9.    
  10. 1 123 <date>
  11. 2 456 <date>
  12.    
  13. #!/bin/bash
  14. # This shell script is to tabulate and search for SR
  15. next_n=$(($(tail -n1 /tmp/cases.txt 2>/dev/null | cut -f1) + 1))
  16. read -p "Enter your SR number : " SR
  17. echo -e "$next_nt$SRt$(date)" >> /tmp/cases.txt
  18.    
  19. [ -s "/tmp/cases.txt" ] || : > /tmp/cases.txt
  20. next_n=$(expr "$(wc -l < /tmp/cases.txt)" + 1)
  21. read -p "Enter your SR number: " SR
  22. printf '%dt%dt%sn' "$next_N" "$SR" "$(date)" >> /tmp/cases.txt
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top