-1

in tcsh we can create a alias for example

alias kate 'kate \!* &'

after this i can run a command on the shell like

kate test.py 

which will be translated to

kate test.py &

what is the equivalent of this in bash?

camh
  • 40,988
  • 13
  • 62
  • 70
pynew
  • 57
  • 1
  • 4
  • possible duplicate of [Shell Script: How to pass command line arguments to an UNIX alias?](http://stackoverflow.com/questions/941338/shell-script-how-to-pass-command-line-arguments-to-an-unix-alias) – Gilles 'SO- stop being evil' Jul 23 '13 at 23:40

3 Answers3

3

Bash does have an alias feature but the Posix syntax (shared by bash, dash, ash, ksh, etc...) is all that is needed for this case so one may as well just do:

kate () {
  /usr/local/bin/kate "$@" &
}
DigitalRoss
  • 143,651
  • 25
  • 248
  • 329
0

In bash you can create alias like this

alias myls='ls -l'

and after that if u type myls it will list the directories

Raghuram
  • 3,937
  • 2
  • 19
  • 25
0

In bash a simple rsh illustrative example to host passed through command line

function myrsh() {
    rsh $1.eng.testme.com -l mylogin
}

Now use $> myrsh <hostname>

Neera
  • 1,577
  • 8
  • 10