[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using SUDO in bash script



Michael Rauch wrote:

instead of writing a shellscript you could also use aliases in the bash
shell (don't know if it works in other shells though). to have your
aliases available all the time, you can but them in your .bashrc file in
your $HOME directory (you will probably already find some aliases
defined in there).

example:
$ alias ls='cd'

doesn't make much sense, but shows you how it works: ls is now defined
as an alias for cd. so if you type 'ls /home' bash will actually invoke
'cd /home'

And of course, if you try this experiment, you'll want to be aware of the "unalias" command.

$ unalias ls

will undo the above alias.

$ alias

will show you your current aliases.

--
Kent



Reply to: