Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #264775

setting IFS to new line doesn't work while searching?

From Albretch Mueller <lbrtchx@gmail.com>
Newsgroups linux.debian.user
Subject setting IFS to new line doesn't work while searching?
Date 2023-12-15 13:40 +0100
Message-ID <HLfDX-dKFZ-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


sdir="$(pwd)"
#fndar=($(IFS=$'\n'; find "$sdir" -type f -printf '%P|%TY-%Tm-%Td
%TI:%TM|%s\n' | sort --version-sort --reverse))
#fndar=($(IFS='\n'; find "$sdir" -type f -printf '%P|%TY-%Tm-%Td
%TI:%TM|%s\n' | sort --version-sort --reverse))
fndar=($(find "$sdir" -type f -printf '%P|%TY-%Tm-%Td %TI:%TM|%s\n' |
sort --version-sort --reverse))
fndarl=${#fndar[@]}
echo "// __ \$fndarl: |${fndarl}|${fndar[0]}"

the array construct ($( ... )) is using the space (between the date
and the time) also to split array elements, but file names and paths
may contain spaces, so ($( ... )) should have a way to reset its
parsing metadata, or, do you know of any other way to get each whole
-printf ... line out of find as part of array elements?

lbrtchx

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

setting IFS to new line doesn't work while searching? Albretch Mueller <lbrtchx@gmail.com> - 2023-12-15 13:40 +0100
  Re: setting IFS to new line doesn't work while searching? Greg Wooledge <greg@wooledge.org> - 2023-12-15 13:50 +0100
    Re: setting IFS to new line doesn't work while searching? Albretch Mueller <lbrtchx@gmail.com> - 2023-12-15 14:10 +0100
  Re: setting IFS to new line doesn't work while searching? Nicolas George <george@nsup.org> - 2023-12-15 13:50 +0100
    Re: setting IFS to new line doesn't work while searching? Greg Wooledge <greg@wooledge.org> - 2023-12-15 14:10 +0100
      Re: setting IFS to new line doesn't work while searching? Nicolas George <george@nsup.org> - 2023-12-15 14:40 +0100
        Re: setting IFS to new line doesn't work while searching? Greg Wooledge <greg@wooledge.org> - 2023-12-15 15:00 +0100
          Re: setting IFS to new line doesn't work while searching? Nicolas George <george@nsup.org> - 2023-12-15 15:10 +0100
          Re: setting IFS to new line doesn't work while searching? David Wright <deblis@lionunicorn.co.uk> - 2023-12-16 06:50 +0100

csiph-web