HACKER Q&A
📣 ent101

If you could reinvent the Shell, what would you do differently?


If you could reinvent the Shell, what would you do differently?


  👤 TBurette Accepted Answer ✓
Make it check for errors by default instead of blindly keeping running (set -euo by default).

Have a way to undelete files (undelete or a trash folder).

Not being so whitespace sensitive. One of those two commands does what you think it does, the other not : grep --exclude-dir= ".git" -rl 123 . grep --exclude-dir=".git" -rl 123 .

Make it easier to iterate through file of a directory no matter what the filenames may contain(dashes, spaces,...)

Be more consistant between different commands.

  adduser vs newgrp
  -o vs + (Or-ing elements)
Use a modern regexp. For example with grep x* works but x? doesn't (you must use x\? or a flag)

Write man pages so that they are useful in the 'I have an idea what this command does and want to learn it' scenario, not just 'I know this command and need a quick refresher on a specific flag'.


👤 gregjor
There’s no “the shell,” assuming you’re asking about the Unix/Linux shell. Besides the common sh and bash you can use any number of shells. Lots of people have reinvented the shell and done things differently. It’s just a program.

https://en.wikipedia.org/wiki/Unix_shell


👤 m463
Add extensive string processing and handling. Pipelines of sed/grep/awk should be handled natively.

make directory/file handling built-in. Maybe add functions that easily handle directory and filenames with say spaces, quotes and unicode to get rid of horrendous quoting workarounds.

make regex stuff more accessible - the case statement is pretty good, put it other places.