$$\
$$ |
$$$$$$$ | $$$$$$\ $$\ $$\ $$$$$$\ $$\ $$\ $$$$$$\
$$ __$$ |$$ __$$\\$$\ $$ |$$ __$$\ \$$\ $$ |$$ __$$\
$$ / $$ |$$$$$$$$ |\$$\$$ / $$$$$$$$ | \$$$$ / $$ / $$ |
$$ | $$ |$$ ____| \$$$ / $$ ____| $$ $$< $$ | $$ |
\$$$$$$$ |\$$$$$$$\ \$ / \$$$$$$$\ $$ /\$$\ $$$$$$$ |
\_______| \_______| \_/ \_______|\__/ \__|$$ ____/
$$ |
$$ |
\__|
This project creates symbolic links with the same base filename if the file extension is *.s
within the directory that is provided as an argument, and skips the rest of the files. Also, one should know that the symbolic link always ends in *.t
extension.
These symbolic links can be tested using a separate script included in this repository.
- It will check if the directory argument is empty. If yes, it will display the
usage
and exit (exit 1
). - If the argument is not empty, the script will start checking if there are files that end in
*.s
extension inside the provided path, and it will exit if such files do not exist (exit 2
). - If the files are present, the script will start creating symbolic links and it will write the paths to
results.txt
.
- It will check if the
results.txt
exists. If not, it will returnNothing to test here.
and exit (exit 1
). - If the
results.txt
does exist, the script will parse path by getting the first field usingawk
and by removing the single quotes globally ('
) usingsed
. After parsing, the values will be assigned toFILES
variable. - Using the
FILES
variable, the script will check if each file exists and if it is a symbolic link. - If it is not a symbolic link, it will display an error that it does not exist.
- Successful test results will display something like this:
/path/to/file is a symlink
.
- Docker Desktop
- Tested using Docker Desktop for macOS v3.3.3 (64133)
- Engine version 20.10.6, build 370c289
- Ubuntu Official Docker Image
- Tested using
ubuntu:latest
- Image Digest:
sha256:adf73ca014822ad8237623d388cedf4d5346aa72c270c5acc01431cc93e18e2d
- Tested using
git clone https://github.com/jpdoria/devexp.git
docker pull ubuntu:latest
docker run --name devexp --rm -it -v $PWD/devexp:/root/devexp -w /root/devexp ubuntu:latest bash
./start.sh <path/to/directory>
./test.sh