Skip to main content

Timeline for Bash array with spaces in elements

Current License: CC BY-SA 4.0

21 events
when toggle format what by license comment
Jan 4, 2023 at 23:13 answer added Manabu Nakazawa timeline score: 2
Oct 30, 2021 at 18:32 answer added ychz timeline score: 6
Sep 18, 2021 at 22:16 answer added Alcamtar timeline score: 14
Aug 12, 2021 at 19:35 answer added subham prasad timeline score: 3
May 1, 2020 at 4:20 comment added Alex Hall All of the answers here break down for me using Cygwin. It does weird things if there are spaces in file names, period. I work around it by creating an "array" in a text file listing of all elements I want to work with, and iterating over lines in the file: Formatting is mucking with intended backticks here surrounding the command in parenthesis: IFS=""; array=(find . -maxdepth 1 -type f -iname \*.$1 -printf '%f\n'); for element in ${array[@]}; do echo $element; done
Mar 6, 2020 at 15:38 answer added Madan Sapkota timeline score: -1
Jun 13, 2019 at 20:42 answer added Mark Stosberg timeline score: 0
May 6, 2019 at 1:20 answer added Jonni2016aa timeline score: 9
Jun 7, 2018 at 22:37 history edited Benjamin W. CC BY-SA 4.0
Copy edit
Apr 21, 2018 at 8:28 comment added Ciro Santilli OurBigBook.com POSIX: stackoverflow.com/questions/2936922/…
Oct 16, 2017 at 18:05 answer added Javier Salas timeline score: 0
Aug 2, 2017 at 16:24 answer added TNT timeline score: 3
May 9, 2013 at 0:51 answer added Dean Hall timeline score: 17
Sep 24, 2012 at 14:23 answer added Khushneet timeline score: 60
Feb 1, 2012 at 0:37 answer added user123444555621 timeline score: 128
Jan 31, 2012 at 17:55 vote accept abelenky
Jan 31, 2012 at 17:54 answer added Dan Fego timeline score: 163
Jan 31, 2012 at 17:49 answer added Chris Seymour timeline score: 2
Jan 31, 2012 at 17:48 history edited abelenky CC BY-SA 3.0
added 5 characters in body
Jan 31, 2012 at 17:43 comment added Dan Fego Have you tried adding the files the old-fashioned way? Like FILES[0] = ...? (Edit: I just did; doesn't work. Interesting).
Jan 31, 2012 at 17:40 history asked abelenky CC BY-SA 3.0