logo

Crowdly

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

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

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.

More questions like this

Want instant access to all verified answers on esiclass.esi.dz?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!