Hi i have a script script.sh which asks to pass a value at the time of execution such as 1 for backup 2 for copy 3 for print. In which i have to pass a value through command line. I just want to pass those values automatically at the time of execution of the shell file. Please provide a solution.
From your comments, I deduce you are expecting your script to behave like a complex daemon, which wold invoke itself programmatically.
I think you should write another script to manage the level of automation you require. Said script wold invoke the one you have, with the logic you require
In bash, you can do:
alias script.sh='script.sh 1'
To always run
script.sh 1 when
script.sh is typed.