help-bash
[Top][All Lists]
Advanced

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

Re: Loop with files coming through sorted by name


From: Greg Wooledge
Subject: Re: Loop with files coming through sorted by name
Date: Mon, 18 Oct 2021 18:59:59 -0400

On Mon, Oct 18, 2021 at 05:32:42PM -0400, Daniel Mills wrote:
> On Sat, Oct 16, 2021 at 10:10 PM tolugboji <tolugboji@protonmail.com> wrote:
> 
> >
> >
> >    nf=$( echo "$fnam" | awk -F '-' '{print NF}')
> >    ifld=$(( nf + 1 ))
> >
> >
> >
> if you're using NF like this, you don't want to add 1, you're ending up
> with a value that's too high. I wouldn't get awk involved here, just do
> nf=${fname//[!-]}; ifld=$((${#nf}+1)). Much faster.

The excessive use of awk is a side effect of xmb being the primary
source of advice in this thread.  Very few other people are willing
to give the OP any assistance at this point, because of the past year's
history with them.



reply via email to

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