Adding tab/new line at the end of each line of a file

view full story

http://www.unix.com – Hello Everyone, I need a help from experts of this community regarding one of the issue that I am facing with shell scripting. My requirement is to append char's at the end of each line of a file. The char that will be appended is variable and will be passed through command line. The script that I have written append almost all char but I am facing a problem with appending \t or \n when using the variable concept. However, if I hardcode \t and \n in the scripts , its working fine. The sample file (TESTDATA.txt) that I have created is as shown below : 137798|Sourav_Das|100 127798|S_Das|10 (HowTos)