|
|
|
|
|
by spudlyo
5395 days ago
|
|
Most shell scripts are a collection of undeclared external dependencies. You can't really rely on sed, awk, and grep to behave the same way on Linux as they do on Solaris or AIX. It seems like if you're concerned with portability, you shouldn't be writing a shell script in the first place. |
|
Yes the tools behave differently on different systems, but 99.9% of the time there's very basic syntax that is respected across all versions of the tools. Stick to BSD4.4 C Shell syntax (http://docs.freebsd.org/44doc/usd/04.csh/paper.html), don't rely on regular expressions in grep, and stick to the very basics of sed and awk and you can go pretty far in Unix.
Any of the following commands which existed on some archaic version of Unix will still exist and their limited but useful functionality can be extended in lots of ways, and is pretty darn portable. https://secure.wikimedia.org/wikipedia/en/wiki/List_of_Unix_...