Skip to content

Create some sample files #79

@lakruzz

Description

@lakruzz

The following snippet will run in a linux terminal.

You can copy it, paste into the terminal of the CodeSpace - and it will run. You may have to hit <ENTER> to execute the very last command too.

But Before you actually run it - try to guess (make your notes in the comments)

  • What will happen when you run it?
  • Will it actually work as it is - or do you need to correct anything?
  • What programming language is this?
mkdir samples
mkdir samples/animals
mkdir samples/animals/countries
mkdir samples/animals/countries/movies

ANIMALS=('Apes' 'Elephants' 'Elephant babies' 'Monkies' 'apes')
COUNTRIES=('Denmark' 'Sweden' 'USA' 'France' 'Italy' '.apes' 'North Korea')
MOVIES=('Batman' 'Sex And The City' 'JFK' 'Poltergeist' 'Germany')

cd samples/animals 
for id in ${ANIMALS[@]}
do
echo $id >> $id.txt
done

cd countries
for id in ${COUNTRIES[@]}
do
echo $id >> $id.txt
done

cd movies
for id in ${MOVIES[@]}
do
echo $id >> $id.txt
done
  • Did it actually work as expected - comment on this in the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    templateIncluded in the template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions