Skip to content

Instantly share code, notes, and snippets.

@yyoops
Forked from caruccio/bash-named-param
Last active August 16, 2018 09:31
Show Gist options
  • Save yyoops/5d7d8b9c1f1cece05313658e09527fba to your computer and use it in GitHub Desktop.
Save yyoops/5d7d8b9c1f1cece05313658e09527fba to your computer and use it in GitHub Desktop.
Named parameters in bash
# Do you like python named parameters (kvargs) ?
# Well, you can have it in bash too!!
$ function myfunc() { local $*; echo "foo=$foo, bar=$bar"; }
$ myfunc bar=world foo=hello
foo=hello, bar=world
# Do you like python named parameters (kvargs) ?
# Well, you can have it in bash too!!
$ myfunc() { local $*; echo "foo=$foo, bar=$bar"; }
$ myfunc foo=sdss bar="kdkd;skldflsf&&kd"
foo=sdss, bar=kdkd;skldflsf&&kd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment