Reputation: 1935
I would like to send alias with input parameters to a back
the alias:
alias aaa="/script.sh"
usage:
aaa input1 input2 inpu3
now i can send aaa to background by adding "&> /dev/null &" but adding this to an alias doesn't work because of the input
aaa input1 input2 inpu3 &> /dev/null &
what i have tried so far:
alias aaa="/script.sh &> /dev/null &"
Upvotes: 0
Views: 1247
Reputation: 3695
Write another script file with code below inside it and make alias for that.
script2.sh:
./script.sh "$@" > /dev/null &
Make alias:
alias aaa="./script2.sh"
Upvotes: 0
Reputation: 229108
You can't do that with an alias. Make a function insted.
function aaa() {
script.sh $@ &
}
aaa input1 input2 inpu3 > /dev/null
Upvotes: 11
Reputation: 10507
You could always just run it... Hit ctrl-z then type bg. This will run it in the background.
Upvotes: 0