I have an alias, that runs a function (named timer) with nohup. I like to pass a parameter to the alias, but it doesn't work.
Here is what I have in my bashrc:
timer() {
arg1=$@
echo "$arg1"
# ...
}
export -f timer
alias timer_ugly='nohup bash -c timer "$@" &'
I also tried
alias timer_ugly='nohup bash -c timer "$1" &'
is there way to make my alias take an argument that get passed to my function ?
Update: I figured out alias does not take parameters, and I tried to make a function instead and that doesnt work either.
this also didn't work: the function takes the parameter but nohup doesnt.
timer_nohup() {
echo "TODO "
echo $@
nohup bash -c timer $@ &
}