fork download
  1. #!/bin/bash
  2. s="Shriii|Fourth|ADCET
  3. Chaitraliii|Fourth|ADCET
  4. Shubhangi|Fourth|ADCET
  5. Prathamesh|Third|RIT
  6. Tushar|Third|RIT
  7. Sukrut|Second|KIT"
  8. grep 'ADCET$' <<< "$s" | sed 's/^\([^|]*\)\(|.*|\)\([^|]*\)$/\3\2\1/'
  9. grep 'ADCET$' <<< "$s" | awk 'BEGIN {OFS=FS="|"} {temp=$NF;$NF=$1;$1=temp;}1'
Success #stdin #stdout 0s 23336KB
stdin
Standard input is empty
stdout
ADCET|Fourth|Shriii
ADCET|Fourth|Chaitraliii
ADCET|Fourth|Shubhangi
ADCET|Fourth|Shriii
ADCET|Fourth|Chaitraliii
ADCET|Fourth|Shubhangi