Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- hcd1="hash(" # string to be added
- hcd2=")as " #string to be added
- dmk=id,cust
- IFS=" ,"
- i=0
- for val in ${dmk}
- do
- i=$((++i))
- eval var${i}="${val}"
- done
- for ((j=1;j<=i;++j))
- do
- name="var${j}"
- colname="col${j}"
- echo ${colname} = "$hcd1${!name}$hcd2 ${!name}"
- done
- echo "$colname1 $colname2 "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement