My first shell program

xiaoxiao2021-03-05  22

LS -A

echo "Which file you want to operate?"

Read filename

Echo "1. RM 2. Cat 3.exit"

Read Select

While [$ SELECT -LT 3]

DO

IF [$ SELECT-EQ 1]; THEN

echo "Do: RM $ filename?"

Read yesorno

IF [$ yesorno "=" y "]; then

RM -F $ filename

Fi

Else

IF [$ SELECT-EQ 2]; THEN

Cat $ filename

Else

Exit

Fi

Fi

LS -A

echo "Which file you want to operate?"

Read filename

Echo "1. RM 2. Cat 3.exit"

Read Select

DONE

转载请注明原文地址:https://www.9cbs.com/read-38570.html

New Post(0)