I tried running this code:
#!/bin/bash
read -s "Password: " password
With command:
run sh init.sh
it throws an error: read: Illegal option -s. Any help.
I take it you're using Debian/Ubuntu, or a BSD-derivative?
When you execute a command like run sh init.sh (although I'm not myself familiar with this run command) you are overriding the #!/bin/bash shebang. In your case sh is a strictly compliant POSIX shell like dash, where, in fact, the only argument to read that is not an extension is -r.
So maybe you'd want to use run bash init.sh instead?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With