Linux shell中read如何换行

有时需要在用read获取输入前,输出相关提示信息给用户,提示信息过长的时候,换行才比较好看,实现示例如下:

read -p $'Here is new linex0aInput something:' inputstr

效果如下:

read -p $'Here is new linex0aInput something:' inputstr
Here is new line
Input something:

相关参考:
shell中使用read如何换行
shell读取键盘输入

未经允许不得转载:阿藏博客 » Linux shell中read如何换行