generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathscript-01.sh
More file actions
executable file
·19 lines (13 loc) · 663 Bytes
/
script-01.sh
File metadata and controls
executable file
·19 lines (13 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
set -euo pipefail
# Do not change this part of the script - only change after the TODO comment.
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
if [[ "${script_dir}" != "$(pwd)" ]]; then
echo >&2 "ERROR: You haven't cd'd into the correct directory."
echo >&2 "For each exercise, you should cd to the directory containing the script before running it."
exit 1
fi
# TODO: Write a command to list the files and folders in this directory.
# The output should be a list of names including child-directory, script-01.sh, script-02.sh, and more.
#I'm in the current folder, And I used cd, now just need to use ls
ls