You’re printing the result of the gsub
, but gsub
does an in-place modify of $2
instead of returning a modified copy. Call gsub
, then print:
awk -F\, '{gsub(/[ \t]+$/, "", $2); print $2 ":"}'
More Related Contents:
- sh: 1: Syntax error: "(" unexpected error
- How can I quickly sum all numbers in a file?
- Insert multiple lines into a file after specified pattern using shell script
- How to ‘grep’ a continuous stream?
- ./configure : /bin/sh^M : bad interpreter [duplicate]
- The ‘eval’ command in Bash and its typical uses
- How to parse XML using shellscript? [duplicate]
- How to join multiple lines of file names into one with custom delimiter?
- How do I know the script file name in a Bash script?
- Linux: copy and create destination dir if it does not exist
- Get program execution time in the shell
- How to handle more than 10 parameters in shell
- Linux bash: Multiple variable assignment
- How to sort a file in-place?
- Is it OK to use the same input file as output of a piped command?
- Finding contents of one file in another file
- Changing default shell in Linux [closed]
- Example of using named pipes in Linux shell (Bash)
- Passing variables in remote ssh command
- When to wrap quotes around a shell variable?
- How to get file creation date/time in Bash/Debian?
- Execute command after every command in bash
- How do I change bash history completion to complete what’s already on the line?
- How to join multiple lines of filenames into one with custom delimiter
- Running shell script in parallel
- How to check if sed has changed a file
- Counter increment in Bash loop not working
- Replace whitespace with a comma in a text file in Linux
- How to pass parameters to a Bash script?
- Using awk to count the number of occurrences of a word in a column