Create a file `remake.sh`, which will take one argument, the relative path of a directory, and will create new files and directories in it. The new files and directories created must have the same name, permission and modification dates as shown in the example below.
Create a file `remake.sh`, which will take one argument, the relative path of a directory, and will create new files and directories in it. The new files and directories created must have the same name, permission and modification dates as shown in the example below.
If the number of given arguments is not one, your script should print `Error` and exit with the status code 1.
If the number of given arguments is not one or if the directory given as argument does not exist, your script should print `Error` and exit with the status code 1.
Below the expected behavior of your script:
Below the expected behavior of your script:
@ -25,5 +25,19 @@ $
- `touch -t <file-path>` allows to specify the modification time in the format `[[CC]YY]MMDDhhmm[.ss]` instead of the current time for the file at `<file-path>`.
- `touch -t <file-path>` allows to specify the modification time in the format `[[CC]YY]MMDDhhmm[.ss]` instead of the current time for the file at `<file-path>`.
- it is possible to check whether a file or a directory exists with the following commands:
```bash
if [[ -d $DIRPATH ]]; then # for a directory
echo "the $DIRPATH exists"
fi
```
```bash
if [[ -f $FILEPATH ]]; then # for a file
echo "the $FILEPATH exists"
fi
```
> You have to use Man or Google to know more about commands flags, in order to solve this exercise!
> You have to use Man or Google to know more about commands flags, in order to solve this exercise!