I have this piece of bash code below,
#!/bin/bash
while true; do
read -rsn1 input
if [ "$input" = "a" ]; then
echo "triggered"
fi
done
It works fine when I press "a" key, however what I really want is trigger something when user press TAB key. How can I make it work? Many thanks for help!
如果您不希望使用IFS
拆分扫描,则将IFS
设置为空。
IFS= read -rsn1 input
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.