Hi all,
As I'm relatively new to bash scripts, I would need some help if you don't mind, please.
I've written a bash script and it is working perfectly on test files. Now, I would like to use command line arguments so I can use this bash script on any other files I want.
For example, I have this line in my script with a test file:
cut -f 1 TEST_FILE.txt > headers.txt
I would like to be able to do something like this in my Linux terminal:
bash script.sh -i input_any_file.txt
And in my script:
cut -f 1 any_file.txt > headers.txt
So how can I use an input file in an argument and "call" this file on the script? If you have any suggestions, I would be happy to hear them ...
Thank you in advance!