Looking for Introduction aux Système d'Exploitation 1 test answers and solutions? Browse our comprehensive collection of verified answers for Introduction aux Système d'Exploitation 1 at esiclass.esi.dz.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Analyze the following scenario and answer the questions.
user1@PC:~$ ls -F /home/user*
/home/user1:
file 'Free palestine' Palestine/ script2 Videos/
/home/user2:
Free/ palestine/ Palestine
/home/user3:
'Free palestine'
/home/user4:
'Free palestine' Palestine/
user1@PC:~$ cat -n Free\ palestine
1
2 Free palestine
user1@PC:~$ cat -n /home/user3/Free\ palestine
user1@PC:~$ cat -n /home/user4/Free\ palestine
1 Free palestine
user1@PC:~$ cat script2
for i in `seq 1 4`
do
note=0
Usr="user$i"
obj1="/home/$Usr/Desktop/`whoami`/Palestine"
obj2="/home/$Usr/Desktop/`whoami`/Free palestine"
if [ -d "$obj1" ]
then
let note=$note+1
fi
if [ -f "$obj2" ]
then
let note=$note+1
l=`grep -n ^"Free palestine" "$obj2" | cut -d":" -f1`
if [ "$l" = "2" ]
then
let note=$note+1
fi
fi
echo "The grade of $Usr is ${note}/3"
done
Question:
Select the correct result after executing script 2. The grade of user1 is:
Question:
Select the command(s) that behave identically to the following command:
mv "$obj" ~/Files/"$usr"_"$obj"
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 11 to 20.
Scenario H:
> 120
> 10
> 1
> 111
> 30
> FIN
1
10
30
111
120
Question:
Select the correct command(s) to obtain Scenario H:
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 1 to 10.
Scenario A:
user1@PC:~$ cat file
user3:x:1001:1003:,,,:/home/user3:/bin/bash
user1:x:1002:1001:,,,:/home/user1:/bin/bash
user2:x:1003:1002:,,,:/home/user2:/bin/bash
user4:x:1004:1004:,,,:/home/user4:/bin/bash
Scenario F:
4
Question:
Given Scenario A, select the correct command(s) to obtain Scenario F:
Scenario A:
user1@PC:~$ cat file
user3:x:1001:1003:,,,:/home/user3:/bin/bash
user1:x:1002:1001:,,,:/home/user1:/bin/bash
user2:x:1003:1002:,,,:/home/user2:/bin/bash
user4:x:1004:1004:,,,:/home/user4:/bin/bash
Scenario G:
user1@PC:~$ cat 1
user3
user1
user2
user4
user1@PC:~$ cat 2
/home/user3
/home/user1
/home/user2
/home/user4
user1@PC:~$ cat 3
user3:/home/user3
user1:/home/user1
user2:/home/user2
user4:/home/user4
Question:
Given Scenario A, select the correct command(s) to obtain Scenario G:
Scenario A:
user1@PC:~$ cat file
user3:x:1001:1003:,,,:/home/user3:/bin/bash
user1:x:1002:1001:,,,:/home/user1:/bin/bash
user2:x:1003:1002:,,,:/home/user2:/bin/bash
user4:x:1004:1004:,,,:/home/user4:/bin/bash
Scenario C:
1:user3:x:1001:1003:,,,:/home/user3:/bin/bash
2:user1:x:1002:1001:,,,:/home/user1:/bin/bash
Question:
Given Scenario A, select the correct command(s) to obtain Scenario C:
Scenario A:
user1@PC:~$ cat file
user3:x:1001:1003:,,,:/home/user3:/bin/bash
user1:x:1002:1001:,,,:/home/user1:/bin/bash
user2:x:1003:1002:,,,:/home/user2:/bin/bash
user4:x:1004:1004:,,,:/home/user4:/bin/bash
Scenario E:
user1 x 1002 1001 ,,, home user1 bin bash
user2 x 1003 1002 ,,, home user2 bin bash
user3 x 1001 1003 ,,, home user3 bin bash
user4 x 1004 1004 ,,, home user4 bin bash
Question:
Given Scenario A, select the correct command(s) to obtain Scenario E:
Scenario A:
user1@PC:~$ cat file
user3:x:1001:1003:,,,:/home/user3:/bin/bash
user1:x:1002:1001:,,,:/home/user1:/bin/bash
user2:x:1003:1002:,,,:/home/user2:/bin/bash
user4:x:1004:1004:,,,:/home/user4:/bin/bash
Scenario D:
user3:
user1:
user2:
user4:
Question:
Given Scenario A, select the correct command(s) to obtain Scenario D:
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!