On 04/16/2010 10:33 AM, davidarnst...@panix.com wrote:
> Thank you Robert Pendell! I wrote this shell script. Any suggestions
> for optimization?
> 
> #!/bin/bash
> if [ $# -eq 1 ]
> then
>         echo "Usage: elev program arg1 arg2 ..."
>         exit 1
> fi
> prog="$1"

In assignment, there is no field splitting, so "" is redundant; this is
equivalent:

prog=$1

> shift
> exec cygstart --action=runas `which "$prog"` "$@"

You are missing some quotes, and might as well use nicer quoting styles:

exec cygstart --action=runas "$(which "$prog") "$@"

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to