From 3410c9ee5aae9aa87bd58c85f1dabc1845b23b17 Mon Sep 17 00:00:00 2001 From: miguel Date: Mon, 12 Dec 2022 15:51:54 +0000 Subject: [PATCH] docs(strange-files): moving the subject to the folder devops fix readme and add more files --- .../solutions/\"\\?$*'Hard_file'*$?\\\"" | 0 "sh/tests/solutions/\"medium_File!\"" | 1 + sh/tests/solutions/firstFile | 1 + sh/tests/strange-files_test.sh | 4 ++- subjects/{ => devops}/strange-files/README.md | 29 +++++++++++++++---- 5 files changed, 29 insertions(+), 6 deletions(-) rename "sh/tests/solutions/\"\\?$*'First_file'*$?\\\"" => "sh/tests/solutions/\"\\?$*'Hard_file'*$?\\\"" (100%) create mode 100644 "sh/tests/solutions/\"medium_File!\"" create mode 100644 sh/tests/solutions/firstFile rename subjects/{ => devops}/strange-files/README.md (58%) diff --git "a/sh/tests/solutions/\"\\?$*'First_file'*$?\\\"" "b/sh/tests/solutions/\"\\?$*'Hard_file'*$?\\\"" similarity index 100% rename from "sh/tests/solutions/\"\\?$*'First_file'*$?\\\"" rename to "sh/tests/solutions/\"\\?$*'Hard_file'*$?\\\"" diff --git "a/sh/tests/solutions/\"medium_File!\"" "b/sh/tests/solutions/\"medium_File!\"" new file mode 100644 index 000000000..f9406d9c8 --- /dev/null +++ "b/sh/tests/solutions/\"medium_File!\"" @@ -0,0 +1 @@ +Random text inside! \ No newline at end of file diff --git a/sh/tests/solutions/firstFile b/sh/tests/solutions/firstFile new file mode 100644 index 000000000..f9406d9c8 --- /dev/null +++ b/sh/tests/solutions/firstFile @@ -0,0 +1 @@ +Random text inside! \ No newline at end of file diff --git a/sh/tests/strange-files_test.sh b/sh/tests/strange-files_test.sh index 117af30e5..01bcc6987 100755 --- a/sh/tests/strange-files_test.sh +++ b/sh/tests/strange-files_test.sh @@ -5,4 +5,6 @@ set -euo pipefail IFS=' ' -diff student/\"\\?\$*\'First_file\'*\$?\\\" solutions/\"\\?\$*\'First_file\'*\$?\\\" +diff student/firstFile solutions/firstFile +diff student/\"medium_File\!\" solutions/\"medium_File\!\" +diff student/\"\\?\$*\'Hard_file\'*\$?\\\" solutions/\"\\?\$*\'Hard_file\'*\$?\\\" diff --git a/subjects/strange-files/README.md b/subjects/devops/strange-files/README.md similarity index 58% rename from subjects/strange-files/README.md rename to subjects/devops/strange-files/README.md index 13f41c442..d178738be 100644 --- a/subjects/strange-files/README.md +++ b/subjects/devops/strange-files/README.md @@ -27,17 +27,36 @@ Example: If you want to create a file named `foo!\.txt` You have to escape the characters like so: ```console -User-> code foo\!\\.txt +$ touch foo\!\\.txt ``` ### Instructions -Create a file `"\?$*'First_file'*$?\"` that will contain `Random text inside!` and **nothing else**. +Create a file the following files: + +- `firstFile` which contains `Random text inside!` and **nothing else** +- `"medium_File!"` which contains `Random text inside!` and **nothing else** +- `"\?$*'Hard_file'*$?\"` which contains `Random text inside!` and **nothing else**. ### Usage ```console -User-> ls | cat -e -"\?$*'First_file'*$?\"$ -User-> +$ ls | cat -e +"?$*'First_file'*$?\"$ +firstFile$ +"medium_file!"$ +$ ``` + +### Hints + +- `ls`. List directory contents. +- `touch` used to create, change and modify timestamps of a file. + +> You have to use Man or Google to know more about commands flags, in order to solve this exercise! +> Google and Man will be your friends! + +### References + +- [ls](https://www.gnu.org/software/coreutils/ls). +- [touch](https://www.gnu.org/software/coreutils/touch).