help-bash
[Top][All Lists]
Advanced

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

Re: whats wrong with my code , [[ $arg == s ]] and case $a in .. not wor


From: alex xmb ratchev
Subject: Re: whats wrong with my code , [[ $arg == s ]] and case $a in .. not working
Date: Sun, 5 Mar 2023 00:22:25 +0100

On Sun, Mar 5, 2023, 12:13 AM Greg Wooledge <greg@wooledge.org> wrote:

> On Sat, Mar 04, 2023 at 11:48:55PM +0100, alex xmb ratchev wrote:
>
> =============================================
> #!/bin/bash
> unset -v a r IFS
> IFS=$' \t\n'
>    for a ; do
>   case $a in
>  s)
> r+=( search ) ;;
>  S)
> r+=( show ) ;;
>  *)
> r+=( "$a" ) ;;
>   esac
>    done
>
> apt-cache "$@"
> =============================================
>
> You're assigning words to an array named r, but then you never use
> that array.  You're passing the original "$@" instead of "${r[@]}".
>

oo aa .. thank you much mate ..

>


reply via email to

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