[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ~/.bashrc problem



On Fri, Apr 15, 2005 at 10:36:34PM +0800, Kuang He wrote:
> Because I am too lazy, I'd like not to type the single quotes myself
> and really wondered if I can work out some ways to solve this. :-)

You could do something like

function header {
    [ $1 ] && URL="$1" || read URL
    wget -O /dev/null -S "$URL"
}

which would give you the option of either using a quoted argument with
the header function, or running the function without arguments and
having it read your URL on one line of stdin (which isn't processed by
your shell and therefore doesn't need quotes).

Arjen



Reply to: