Documente Academic
Documente Profesional
Documente Cultură
Assignment-1
Codingclub
Question-1
a. cat /etc/passwd
b. cat /etc/passwd | awk -F: '{print $1}'
c. cat passwd.txt | awk -F: '{if($3>1000) print $3}'
d. cat passwd.txt | awk -F: '{print $6}'
Question-2
#!/bin/bash
#!/bin/bash
1475 https://fundoopush-dev.bridgelabz.com/login
1141 https://fundoopush-dev.bridgelabz.com/dashboard/article
176 https://fundoopush-dev.bridgelabz.com/add-post
74 http://www.google.com/bot.html
Question-6
3 200
Question-8
3 10.56.2.2
Question-9
read -p "Enter the name of folder you want to make " folderName
if [ -d $folderName ]
then
echo "Folder already exists"
else
mkdir $folderName
echo "Making directory $folderName"
fi
Muskan@DESKTOP-EJUM3U4 MINGW64 ~/Desktop/LinuxLearning/Assignment 1
$./FolderExistsOrNot.shell
Enter the name of folder you want to make Temp
Making directory Temp
Question-10
list=`ls`
status=$?
if [ $status -eq 0 ]
then
echo "ls command executed successfully"
else
echo "ls command not executed successfully"
fi
list=`hello`
status=$?
if [ $status -eq 0 ]
then
echo "hello command executed successfully"
else
echo "hello command not executed successfully"
fi
___________________________________________________________________________
Muskan@DESKTOP-EJUM3U4 MINGW64 ~/Desktop/LinuxLearning/Assignment 1
$ ./checkExecutionStatus.shell
ls command executed successfully
./checkExecutionStatus.shell: line 9: hello: command not found
hello command not executed successfully
Question-11
#!/bin/bash
case "$usersecret" in
"") echo "setting environment variable to dH34xJaa23"
usersecret='dH34xJaa23'
;;
*) echo "Environment variable already set"
;;
esac
Question-12
1.log:4
2.log:6
3.log:11
Question-13
ps -eo pid,ppid,cmd,%mem%cpu
“-o” flag is not supported in git bash so won’t be able to get the output of the above
command.
Question-14
EmployeeName TotalPay
NATHANIEL 567595
GARY 538909
ALBERT 335279
CHRISTOPHER 332343
PATRICK 326373
DAVID 316285
Question-15