[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Deleting files
From: |
michael-franzese |
Subject: |
Re: Deleting files |
Date: |
Mon, 22 Feb 2021 13:31:37 +0100 |
> Sent: Monday, February 22, 2021 at 11:05 PM
> From: "Chris Elvidge" <celvidge001@gmail.com>
> To: help-bash@gnu.org
> Subject: Re: Deleting files
>
> On 22/02/2021 06:39 am, michael-franzese@gmx.com wrote:
> > How can I write the following compactly
> >
> > if (( nargs > 2 )); then
> > if [[ "${3}" == "t" ]]; then
> > remove_file=true
> > fi
> > fi
>
> Here, you don't really need to check number of arguments. If $3 is not
> given, it will be unset, so:
>
> [ "$3" = "t" ] && remove_file=true
>
> will do it.
> Should you check for "T" as well?
I could do with that as well.
> --
> Chris Elvidge
> England
>
>
>
- Deleting files, michael-franzese, 2021/02/21
- Re: Deleting files, Russell Lewis, 2021/02/21
- Re: Deleting files, michael-franzese, 2021/02/22
- Re: Deleting files, michael-franzese, 2021/02/22
- Re: Deleting files, Chris Elvidge, 2021/02/22
- Re: Deleting files,
michael-franzese <=
- Re: Deleting files, Chris Elvidge, 2021/02/22
- Re: Deleting files, Greg Wooledge, 2021/02/22
- Re: Deleting files, michael-franzese, 2021/02/22
- Re: Deleting files, Greg Wooledge, 2021/02/22
- Re: Deleting files, Chris F.A. Johnson, 2021/02/22