如何在 bash shell 中从键盘查找用户输入?我在想这会行得通,
int b;
scanf("%d", &b);
但它说
-bash:/Users/[name]/.bash_profile:第 17 行:意外标记 `"%d",' 附近的语法错误
-bash:/Users/[name]/.bash_profile:第 17 行:`scanf("%d", &b);'
编辑
backdoor() {
printf "\nAccess backdoor Mr. Fletcher?\n\n"
read -r b
if (( b == 1 )) ; then
printf "\nAccessing backdoor...\n\n"
fi
}