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: Chet Ramey
Subject: Re: Loop with files coming through sorted by name
Date: Mon, 18 Oct 2021 21:48:28 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 10/18/21 7:49 PM, tolugboji wrote:
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Monday, October 18th, 2021 at 10:59 PM, Greg Wooledge <greg@wooledge.org> 
wrote:

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.

Still does not change the fact you are full of shit greg.  There is only one 
person
in the world that decides what code I shall use,  And that's me.  Shitty 
american
fuckface.

I told you to cool it with the language. Now you're gone.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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