1
Is there a way to declare and pass parameters for shell functions, like so ?
function msg( m )
{
read -p "Task #" + m + "done. Press any key to continue
}
1
Is there a way to declare and pass parameters for shell functions, like so ?
function msg( m )
{
read -p "Task #" + m + "done. Press any key to continue
}
3
you didn't specify which shell, but assuming bash (or zsh):
function msg() {
read -p "Task #${1} done. Press any key to continue"
}
and then you just use it like
% msg "foobar"
with $0
- $X
you acces the nth parameter, in $*
and $@
you find the whole line. just check the manual of your shell.