Question: Write a bash script named stripTabs. The first argument to the script should be the replacement string for any tab found in a file. The

Write a bash script named stripTabs. The first argument to the script should be the replacement string for any tab found in a file. The remaining arguments, if any, are files. The script should loop over the files passed as arguments, and for each file, replace every tab character with the desired replacement string. If the file does not contain any tabs, then the file should not be changed; otherwise, a message should be displayed, indicating that the tabs were removed from the file. For example: Cuser] cat foo.txt bar.txt foo has no tabs bar has [user]$ stripTabs "- T >" foo.txt bar.txt Removed tabs from bar.txt [user]$ cat foo.txt bar.txt foo has no tabs many tabs [user]$ You may assume that the replacement string does not contain any tab characters. Your script may invoke sed and awk if needed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
