How do you get bash to pass all the parameters to a program. - Setup

This is a discussion on How do you get bash to pass all the parameters to a program. - Setup ; I am creating a local updatedb file for my user acccount and I created a bash script like so. #!/bin/bash # llocate - local locate locate --database=$HOME/.locate/locate.db $1 Naturally any additional parameters to the locate command will fail. Is there ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How do you get bash to pass all the parameters to a program.

  1. How do you get bash to pass all the parameters to a program.


    I am creating a local updatedb file for my user acccount and I created
    a bash script like so.


    #!/bin/bash
    # llocate - local locate
    locate --database=$HOME/.locate/locate.db $1

    Naturally any additional parameters to the locate command will fail.

    Is there a way of adding everything to it?

    I tried alias but that ignored the parameters

    - voipfc


  2. Re: How do you get bash to pass all the parameters to a program.

    On 2007-07-18, voipfc wrote:
    >
    > I am creating a local updatedb file for my user acccount and I created
    > a bash script like so.
    >
    >
    > #!/bin/bash
    > # llocate - local locate
    > locate --database=$HOME/.locate/locate.db $1
    >
    > Naturally any additional parameters to the locate command will fail.
    >
    > Is there a way of adding everything to it?


    locate --database=$HOME/.locate/locate.db "$@"


    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

+ Reply to Thread