60

So I was taking a Linux class in college. I knew Linux pretty good at this point but it was a required course for my degree. I found some other people who were programmers in other languages like python and C and we just fucked around the whole semester. End of semester is coming up and the teacher poses a problem: write a bash script to do this complex thing that bash isn't the best language. But it's a Linux class. Everyone is typing away while the four of us are stunned, having no clue. So we did the only reasonable thing: write a bash script which echos a full python script to achieve it into a file, run that python script, then delete it. We submitted first and got extra credit. She threw it up on the projector as an "extrodinary example" of a good script, having not looked at it. She complimented us profusely, never turning around or reading it.

Comments
  • 2
  • 4
    python -c "print('Die!!!!!\n'.upper()*10000)"
  • 6
    @njpugh90 yea. She chose a program that required multiple if else type statements and wanted us to use the built-in if and case statements. She never said don't use other languages, but probably figured we wouldn't. Bash, I love you, but your conditionals are the worst thing I've ever seen.
  • 3
    Fucking smart bastard. xD
  • 0
    @exceptionalGuy lol OS lab, remember?
  • 8
    Maybe she did read it and knew exactly what she was praising you for? 😏
  • 5
    @0xBE5A this is a possibility I hadn't considered. And I hope it's true. But watching her call it "short, simple, and brilliant" while other people stared at:

    #!/bin/bash
    Echo "several\npython\n\tlines" > x.py
    Python x.py
    Rm x.py

    Made me both proud and embarrassed as hell.
  • 4
  • 1
    @RememberMe Ofcourse. VKB's explanation of how fork() works like a binary tree. Goes the left child, executes, goes back to the parent, executes and then again to the right child and executes. Will never forget that.
  • 1
    @njpugh90 same. I do love bash to death, it has a special place in my heart but as soon as a problen has any sort of branching, decisions, or math I abandon it. Not things bash does gracefully.
  • 0
    @deadPix3l i use spigot for math when i have to use bash.
  • 3
    That is brilliant
Add Comment