5

inserting a token while parsing a file - bash

view full story
linux-howto

http://unix.stackexchange.com – I have a file with this structure: ma${token}jid-azimi-865131021 javad-ya${token}rip-865132012 and here is my program: IFS="-" token="12345678" cat input.txt | while read col1 col2 col3; do echo ${col1} echo ${col2} echo ${col3} echo "********************************" done I want to insert ${token} while reading file. because token is a dynamic word and I can not change it inside the file every time. So I add ${token} to the file once. But the output of program is: ma${token}jid azimi 865131021 ******************************** javad ya${token}rip 865132012 *********** (HowTos)