Saturday, January 28, 2017

[Bash Challenge 8] Can You Solve This Bash Script Puzzle?

Welcome to the Bash Challenge #8 by Yes I Know IT & It’s FOSS. In this weekly challenge, we will show you a terminal screen, and we will count on you to help us obtaining the result we wanted. There can be many solutions, and being creative is the most amusing part of the challenge.

If you haven’t done it already, do take a look at previous challenges:

Ready to play? So here is this week’s challenge.

How to add a header?

This week I work with several data files and one header file. I just want to insert the contents of the header file on top of each data file:

Bash Challenge 8 solve bash script problem

For the sake of the demonstration, I only displayed one file. But you may imagine I have many of them — too many for considering manual editing.

Anyway, for some reason my solution didn’t work: not only I’ve lost the data but my header appears twice.

cat HEADER DATA01 | tee DATA01
# Month, Year, Est.Value
# Month, Year, Est.Value

As you can see, I really need your help here — both to explain to me what was going on and to help me in solving that issue. I’m really looking forward to read your solutions in the comment section below!

Few details

To create this challenge, I used:

  • GNU Bash, version 4.4.5 (x86_64-pc-linux-gnu)
  • Debian 4.8.7-1 (amd64)
  • All commands are those shipped with a standard Debian distribution
  • No commands were aliased

Solution

We’ll post the solution in one week. Meanwhile, you can put your thinking cap on and try to figure what what’s wrong here! Use the comment section below to show us your findings. Have fun :)



from It's F.O.S.S. http://ift.tt/2kEGRT0
via IFTTT

No comments:

Post a Comment

Playing Grand Theft Auto Inside A Neural Network’s Hallucination? It’s Possible!

Ever imagined what a Neural Network's hallucination would look like? The post Playing Grand Theft Auto Inside A Neural Network’s Halluc...