Cześć, mam takie zadanie na studiach informatycznych:
Q1 — Simple conditional scripts and variables
-
Write a shell script called q1-msg.sh that displays a message like the one shown here:
$ ./q1-msg.sh
Hello! This is module CO1101.
The current directory is /the/current/directory
Except that "/the/current/directory" should be replaced with the path of the actual directory where the script is executed.
Will be assessed by running your script and checking that the directory shown actually matches the directory where the script is executed.
-
Write a shell script called q1-tmp.sh that displays a message saying whether or not the working directory is your temporary directory (by referring to the environment variable $TMP, which is not necessarily /tmp/).
$ ./q1-tmp.sh
not in TMP directory
$ cd $TMP
$ /path/to/CO1101/scripts/q1-tmp.sh
in TMP directory
Will be assessed by running your script twice: once within the temporary directory, once elsewhere.
Szczerze powiedziawszy to opuściłem trochę wykładów i nie do końca ogarniam o co chodzi w tych zadaniach. W sensie nawet nie wiem jak zacząć. Pobrałem ubuntu z windows store i siedzę przed ekranem i nie wiem co pisać. To jest pierwsze miejsce, które mi się skojarzyło z pomocnymi ludźmi, więc może będzie ktoś w stanie pomóc.
Pozdrawiam serdecznie