24

My most painful coding error?

```
#!/bin/bash
APP_PREFIX=${1}

#Clean built bin dir before re-compiling
rm -rf ${APP_PREFIX}/bin

make compile
```

Comments
  • 3
    Tag: whatcouldpossiblygowrong
  • 5
    I screamed when I realized what would happen
  • 1
    Oh.

    Oh no.
  • 5
    half a year back something similar happened to me, when i tried so make some scripts for automating stuff. Except it didn't clear the bin folder. It tried to clear all folders on /, most of them successfully..
  • 0
    All gone. 🤭
  • 7
    Pro bash tip, from my hard lesson:

    ${1:-defaultValue}
  • 5
    @devphobe you are not alone.

    Pokes the bumblebee driver devs (Nvidia optimus under linux)

    They had a similar issue, but wiped
    /usr which is pretty more fucked up.
Add Comment