Am trying to create files using variable in a bash script:
new_name=`sed -n "/:20:/p" $file | awk -F: '{print $3}'`
When I echo the variable $new_name, the result is correct:
TRS105489299
When I use the touch command to create the file, the result looks like the below:
'TRS105489299'$'\r'
How can create the file with the name TRS105489299?
$ sed -n "/:20:/p" ~/1.txt | hexdump.exe -C
00000000 3a 32 30 3a 54 52 53 31 30 35 34 38 39 32 39 39 |:20:TRS105489299|
00000010 0d 0a |..|
00000012
$ sed -n "/:20:/p" ~/1.txt | awk -F: '{print $3}' | hexdump.exe -C
00000000 54 52 53 31 30 35 34 38 39 32 39 39 0d 0a |TRS105489299..|
0000000e
Thanks