[Top][All Lists]

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

Which one to use - $@ "$@" $*

From: pauline-galea
Subject: Which one to use - $@ "$@" $*
Date: Fri, 23 Apr 2021 18:09:32 +0200

Have written a grep function to which I can pass arguments.
Am am using "$@".  Reading about this, I found people claiming
that $@ should be quoted, others say it is not required.

Furthermore, there is $* which does not need quoting.
I need help to resolve this because it is still not
clear to me which one to use - $@ "$@" $*

Here are same examples of how I use it.

mygrep -C8 "Great Britain" ./gungadin
mygrep -nhC8 "Great Britain" .
mygrep -C8 --exclude=\*.texi --include=\*.el France .
mygrep -C8 --exclude=\*.{org,texi} --include=\*.el France .

mygrep ()
    grep -ir --include=\*.{org,texi} "$@"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]