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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!