I know little about shell script but I want to try to implement some complicated scripts.Say I have a doitall.sh with the content like:zip -j version_a_en.zip en_filea1.txt en_fileb2.jsonAnd a doitall2.sh with the content like:zip -j version_b_en.zip en_fileb1.txt en_fileb2.jsonHow can I use a and en as parameters so that I can use only one script to handle all the similar requirements. Like./doitall.sh a enor./doitall.sh b fr
How to use passed-in parameters for shell script?
shell script
The commandline parameters a and en can be accessed in shell scripts using $1 and $2:#! /bin/bashzip -j version_$1_$2.zip $2_filea1.txt $2_fileb2.jsoncare has to be taken when you have numbers following them in the text, that is why I always tend to put them in double quotes, but in this case you could leave them out.