bash scripting - read single keystroke including special keys enter and space

后端 未结 3 1980
轻奢々
轻奢々 2020-12-31 18:54

Not sure if I should put this on stackoverflow or unix.stackexchange but I found some similar questions here, so here it goes.

I\'m trying to create a script to be c

3条回答
  •  盖世英雄少女心
    2020-12-31 19:47

    Try setting the read delimiter to an empty string then check the builtin $REPLY variable:

    read -d'' -s -n1
    

    For some reason I couldn't get it to work specifying a variable.

提交回复
热议问题