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 | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.



Relevant Pages