Possible to set "-h" for all programs?
Hi, i was busy setting up aliases for all the different commands that i use that have the -h (human readable format, or something like that) and it occurred to me that maybe, possibly (though i don't know how) it might be possible to set that parameter "universally" or at least for the applications where it can be used. So my question is, is that possible and if so how can it be done? Any help/ideas would be greatly appreciated!
Cheers, -Gaikio |
I could be wrong but to the best of my knowledge your current option of creating aliases is the way to go.
However, I presume you are simply writing an alias for each command? You may be better suited, as i am imagining there are a few you would like to set, to use a loop based on an array of your commands, see below link on reference for how to use arrays in bash. The general idea would be: Code:
comm_array=(ls df) # add as many as required here Reference: http://tldp.org/LDP/abs/html/arrays.html |
I'm afraid that grail's approach is your best bet. The programs are all written by different people (see the bottom of each man page) and there's no enforced std for options...
|
Hi Grail, sorry for the belated reply. I tried your idea and it worked like a charm! Thanks!
|
Hi,
Just a few useful links; Linux Documentation Project Rute Tutorial & Exposition Linux Command Guide Bash Reference Manual <<< Look here Advanced Bash-Scripting Guide <<< and here Linux Newbie Admin Guide LinuxSelfHelp Getting Started with Linux The above links and others can be found at 'Slackware-Links' . More than just SlackwareŽ links! |
Cool. Please mark as SOLVED ;)
|
one (or two) possible disadvantages with the Grail solution is
|
If I need an an alias, I always (usually?) provide new name so it won't interfere with normal operations.
|
I go the other way - if I don't want the (same named) alias I use "\<command> ..."
|
Add -h to everything? Even something like shutdown?
|
@Bratmon - no not everything, just those in the array. So unless he puts shutdown in there halt won't be the default :)
|
All times are GMT -5. The time now is 01:58 AM. |