I'm trying create a csh script.
requirement:
When a script runs it asks for user input. Prompt should wait for 10secs. If not then exit the script. And please also suggest me secure prompt since password should not display in plain text (ex in bash script read -s "")
I have solution for bash script where I can use
And for advance level, the message should look like "prompts end in 10(this number should decrease and lively should visible the timeout secs)"
requirement:
When a script runs it asks for user input. Prompt should wait for 10secs. If not then exit the script. And please also suggest me secure prompt since password should not display in plain text (ex in bash script read -s "")
I have solution for bash script where I can use
read -t 10 username
but I want same in csh
Code:
#!/bin/csh
echo -n "username:"
set req = $<
echo "username is $req"
sed -i.bak "/rootpw/s/edjos/$req/" /boot/loader.conf
And for advance level, the message should look like "prompts end in 10(this number should decrease and lively should visible the timeout secs)"