Let's get rid of the sample files - so we can create them again.
Make sure your working directory is the root of the repository where the samples folder is - change directory if you have to. Now delete the samples folder, and everything in it using rm (it needs a few switches to work - but you'll figure it out).
[x] How can you tell what directory you're in? - Put your reply in the notes to this issue.
[ ] What switches did you need to apply to rm to remove the folder and everything in it? - Put your reply in the notes to this issue.
Create the sample files again using a script
A shell script can do anything that can be done in the terminal. So all you need to do in order to turn the creation of the samples folder and its content into a script is simply to store the commands from before in a file.
[x] Create a file setup-samples.sh in the root of the repository
[x] Take exactly the same code as you ran in the previous issue and copy'n'paste it into the new file.
[x] How do you execute a script in the terminal? Ask around or google it - write you findings in the issue.
Did you manage to run it? I only got this:
Apparently you need to get the permissions right in order to run it.
Make the script executable.
You can see the file permissions and attributes when you use the -l option to the ls command.
This is what I get:
The interesting bit in the context of this issue is the series of letters and dashes in the beginning - it indicates read, write and execute permissions for owner, group and others.
The command you need to use to solve this is called chmod short for change mode you can get different leves of help on the command by running several commands. Try these three one a time:
chmod
chmod --help
man chmod
The are especially useful when you know (just about) what the command is for and you just want to be reminded of syntax or scope.
But if you want a broader perspective I suggest you search a blogpost or something.
[x] What would be a good search phrase to look for help on this topic? - put you suggestion in the notes on the issue.
1 In order to see which directory it is in, you have to write "pwd", after this it will show you where it is located.
2 In order to remove a directory you have to write "rm" which is the remove command, but you also need to add "-r" and the directory you want to remove, in my case it's "samples/"
3 To create a file, you have to write "cat >" and then the same.
5 In order to run code you need to write "Bash" and then the files name, in this case it's "setup-samples.sh".
6 I wrote the question into google, and found a StackOverFlow artical which helped me with the problem.
Get rid of the sample files
Let's get rid of the sample files - so we can create them again.
Make sure your working directory is the root of the repository where the
samples
folder is - change directory if you have to. Now delete thesamples
folder, and everything in it usingrm
(it needs a few switches to work - but you'll figure it out).[x] How can you tell what directory you're in? - Put your reply in the notes to this issue.
[ ] What switches did you need to apply to
rm
to remove the folder and everything in it? - Put your reply in the notes to this issue.Create the sample files again using a script
A shell script can do anything that can be done in the terminal. So all you need to do in order to turn the creation of the
samples
folder and its content into a script is simply to store the commands from before in a file.[x] Create a file
setup-samples.sh
in the root of the repository[x] Take exactly the same code as you ran in the previous issue and copy'n'paste it into the new file.
[x] How do you execute a script in the terminal? Ask around or google it - write you findings in the issue.
Did you manage to run it? I only got this:
Apparently you need to get the permissions right in order to run it.
Make the script executable.
You can see the file permissions and attributes when you use the
-l
option to thels
command.This is what I get:
The interesting bit in the context of this issue is the series of letters and dashes in the beginning - it indicates read, write and execute permissions for owner, group and others.
The command you need to use to solve this is called
chmod
short for change mode you can get different leves of help on the command by running several commands. Try these three one a time:The are especially useful when you know (just about) what the command is for and you just want to be reminded of syntax or scope.
But if you want a broader perspective I suggest you search a blogpost or something.
[x] What would be a good search phrase to look for help on this topic? - put you suggestion in the notes on the issue.
I found this reference it looks comprehensive.
[x] Make a note on this issue, of the
chmod
command that solved the issue.