I want to write Bash script witch will allow me to run commands from a text file.
In file will be special word: "secretcommand" and the proper command in next line.
Example of text file:
This is
my
secretcommand
pwd
bash
script
Now I want in my script to find a "secretcommand". I wanted to use grep -n so I could get the line of this word and then somehow add + 1 to that line so I get number of next line where is proper command. And finally I want to run this command. I wanted use sed -f but it wasn't workin or I'm doing something wrong.
Can you help me please?