Robert P. J. Day wrote:
True, but even complex commands work as an alias. Command line optios override ( some/all ) of the options embeded in the alias. See the 'rm' command for root in all versions of RH/fedora I have used since abt 4.2. It is an alias for 'rm -i' but the use of the -f option will override that.On Sat, 21 Feb 2004, WipeOut wrote:
Jeff Vian wrote:
Well you learn something new every day.. I did not know about "alias" for complex command lines..WipeOut wrote:
Quite simple really.. I usually need to map at least 3 ports to work across the ssh link on each of the servers I am accessing.. So the command line would end up being something like this..Easy enough to either create a script or an alias per server. Then the brain does not have to remember all that each time
ssh -Cg -L xx:<ip>:xx -L yy:<ip>:yy -L zz<ip>:zz <server name>
This is a real PITA to remember or have to type out each time I want to connect..
and if it's a little too complicated for an alias (that is, it needs an
argument or two), there's always shell functions.
One note is that when you create an alias for a normal command, the alias takes precedence. You can override this precedence by using the full path to the normal command.
A smartly written script will allow additonal options to be used from the command line as well.