Skip to content

Instantly share code, notes, and snippets.

@caruccio
Created April 24, 2012 03:25
Show Gist options
  • Select an option

  • Save caruccio/2476150 to your computer and use it in GitHub Desktop.

Select an option

Save caruccio/2476150 to your computer and use it in GitHub Desktop.

Revisions

  1. caruccio revised this gist Apr 24, 2012. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions bash-named-param
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Do you like python named parameters (kvargs) ?
    Well, you can have it in bash too!!
    # 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
    $ function myfunc() { local $*; echo "foo=$foo, bar=$bar"; }
    $ myfunc bar=world foo=hello
    foo=hello, bar=world
  2. caruccio created this gist Apr 24, 2012.
    6 changes: 6 additions & 0 deletions bash-named-param
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    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