I have a script: script
#!/bin/bash
read -n password
if [[ $password = $correct-password ]]; then
custom shell
else
exit
fi
Then, I have another script:
#!/bin/bash
echo password | ./script
commands
I want the commands in the second script to run in my custom shell not bash but they just run in bash. I can't do any changes in my first script. Instead of echo I have tried redirect password from file and here document "<<" still yeilds the same result.
echo password | ./scriptwhich just runs this script as a stand alone, you want to pass in arguments .. Is that what you are asking?ifstatement in the first script is not valid syntax.((should be[[.