Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would that potentially break shell scripts that rely on the standard ls behavior?


If you use `alias ls=elles`, scripts should be unaffected as aliases are ignored in non-interactive shells.


Don't parse the output of ls, use globbing or find. Here are some examples https://mywiki.wooledge.org/ParsingLs


The problem is existing shell scripts not written by yourself.


This is why I encourage not overriding common commands in $PATH. Setup an alias instead so it only applies to interactive shells (or just type the new command :p).

Shell scripting is already fickle enough with compatibility issues across the major implemtations of POSIX utils (GNU, macOS/ BSD, Busybox). Even /bin/sh itself cannot be relied upon to behave consistently across platforms. Notably, Busybox's ash supports the non-POSIX substring syntax that Bash does. This won't work on distro's like Debian where /bin/sh is linked to dash shell.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: