ex-11-03_while.sh
来自「Berkely的学生写的」· Shell 代码 · 共 24 行
SH
24 行
#!/bin/sh# Chapter 11 - Reading User Input# This example demonstrates reading user input in a while loop# As with the previous example, you may have to change the line:## /bin/echo "Enter the name of a directory where are your files located:?\c "## to## /bin/echo -n "Enter the name of a directory where are your files located:?\c "## in order for the output to match the output in the bookRESPONSE=while [ -z "$RESPONSE" ] ; do /bin/echo "Enter the name of a directory where are your files located:?\c " read RESPONSE if [ ! -d "$RESPONSE" ] ; then echo "ERROR: Please enter a directory pathname." RESPONSE= fidone
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?