• 17 Posts
  • 70 Comments
Joined 2 months ago
cake
Cake day: November 22nd, 2025

help-circle



  • This about the IFS variable was eye opening! Thank you SO much! This is exactly what I was trying to understand, namely, how on earth the for-loop is smart enough to understand how to count when I haven’t specified a numerical interval (as I do in for instance C when I practice that). This just solved it all. Thanks! Now I also understand why my code gave me excessive outputs when I changed ls into ls -l. The IFS variable made the for-loop count every single blank space!!! :D


  • Reading this part of the Bash manual for the third time today, I think I finally understood it better, thanks to this part in particular:

    […]execute commands once for each word in the resultant list […]

    In other words, whatever follows in is half expected to result in a list of words (items), each for which command is then executed. Beyond that, I guess I’d have to simply look at the logic behind for-expressions.

    Thanks!