kea-classrooms / ITA-BBS-Amalie956

ITA-BBS-Amalie956 created by GitHub Classroom
0 stars 1 forks source link

Make a script #6

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

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 the samples folder, and everything in it using rm (it needs a few switches to work - but you'll figure it out).

Amalie956 commented 1 year ago

Bruge pwd for at se hvilket directory, jeg er i: billede

Get rid of the sample files: for at slette en folder brug: rm -r samples/ billede

Amalie956 commented 1 year ago

Create the sample files again using a script:

Create a file setup-samples.sh in the root of the repository: billede

Take exactly the same code as you ran in the previous issue and copy'n'paste it into the new file.: billede

Make the script executable: How do you execute a script in the terminal?

 18  touch setup-samples.sh
   19  setup-samples.sh
   20  ls
   21  ls -l
   22  ./setup-samples.sh
   23  chmod
   24  chmod --help
   25  man chmod
   26  chmod +x setup-samples.sh 
   27  ls -la
   28  ./setup-samples.sh 
   29  history

Sådan ser det ud, når det er blevet kørt: billede

Make a note on this issue, of the chmod command that solved the issue: chmod = change mode Det en kommando, der bruges til at ændre permissions for filer og mapper

Amalie956 commented 1 year ago

Glemte at fortælle om shebang

#!/usr/bin/env bash

Se den sidste version af setup-samples.sh som ligger her: 2f005ddf44e76b06cbed92ba27557cfe73e5f3a9