advertisements
_____________________________________________________________________________________________________________________
Normal read command with enter
read -p "Are you Sure?" ans
Are you Sure?y
$ echo $ans
Y
Read command without enter
read -p " Are you Sure?" -n 1 ans
Are you Sure?y$
$ echo $ans
y
How to implement in shell script?
proceed=$(bash -c 'read -p " Are you Sure ? " -n 1 ans;echo "$ans"')
_____________________________________________________________________________________________________________________
0 comments:
Post a Comment