Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. hcd1="hash(" # string to be added
  3. hcd2=")as " #string to be added
  4. dmk=id,cust
  5. IFS=" ,"
  6. i=0
  7. for val in ${dmk}
  8. do
  9. i=$((++i))
  10. eval var${i}="${val}"
  11. done
  12. for ((j=1;j<=i;++j))
  13. do
  14. name="var${j}"
  15. colname="col${j}"
  16. echo ${colname} = "$hcd1${!name}$hcd2 ${!name}"
  17. done
  18. echo "$colname1 $colname2 "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement