logo

Crowdly

Browser

Додати до Chrome

Script Description: The following script moves files from ~/Desktop to ~/Files ...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

Script Description:

The following script moves files from ~/Desktop to ~/Files and directories from   ~/Desktop to    ~/Directories, renaming them in the format username_original-name.

user1@PC:~$ nl    script

1 if    test    -e    ~/Files/

2 then

3 mkdir    ~/Files/

4 fi

5 if [    !    -e    ~/Directories/   ]

6 then

7 mkdir    ~/Directories/

8 fi

9 usr="whoami"

10 cd    ~/Desktop/

11 WD=`pwd`

12 if [    "$WD"=      ~/Desktop    ]

13 then

14 for   obj    in    *

15 do

16 if [   "$obj"    -f    ]

17 then

18 mv    "$obj"      ~/Files/"$usr"_"$obj"

19 fi

20 else

21 then

22 if   test   -d    "$obj"

23 then

24 mv    "$obj"    ~/Directories/"$usr"_"$obj"

25 fi fi

26 od

27 fi

Question :

Identify the lines that contain any errors (logical or syntactical) from lines 21 to 27.

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на esiclass.esi.dz?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome