ls > mylist : What comes first?

Our students are currently working on a controlled assessment task for GCSE Computing and they are coming up with some interesting insights.

One student was looking at the command:

ls > mylist

And he was interested to see that the contents of the ls command actually had the mylist file as part of the listing even though the ‘ls command comes first’ as commented by the student.

So does the ls command run first (in which case the directory listing would not yet have the file mylist) was the question or perhaps the computer has to create the mylist file first so that it can then pipe the output from the ls command into the newly created file…..

Having run this task last year we are encouraging students to be a bit more inquisitive and this was a great example of a student ‘accidentally’ spotting something and then developing this into a question to be answered. Final comment was ‘you better make sure you write this up!’.

The investigation task for OCR GCSE Computing is a nice activity if students find time to actually ask questions and look to dig away at the the prescribed tasks to find out further interesting nuggets.

20151020-190449.jpg