Re: Fascinating problem with bash



Hi again.

On 23.08.2010 21:45, Burton Samograd wrote:
You might have to >> the source file name to a temporary file from
the sourced scripts and then read that after the loop is done. Since
while seems to capture variable setting in its own scope it might be
the only way for what you want to do to work. It also seems that for
loops don't have the same variable capture that while loops do, so
if you could somehow convert them you might now have to use a
temporary file.
Okay, thanks. I was surprised by the behavior, since SHLVL didn't show
any differences between outside, inside the outer and inside the inner loop.

In fact I don't need the names (originally I used a counter instead,
using arithmetic expressions, but the problem was the same) - it's only
important to know *that* something got successfully sourced.

ps. Whatever you used to format your code before sending really
messed it up :)
Sorry for that. Sent it via the web mailer while at the office. That
must have caused the mess-up. I wasn't sure whether attachments are allowed.

// Oliver


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/4C730117.8020104@xxxxxxxxxx



Relevant Pages

  • Re: Slow bash script
    ... getting only about one iteration per second in the while loop. ... It extracts md5sums from a 180k Packages file and makes an indices file. ... though I'm no script master, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: loading huge number of rules in iptables (blocklist)
    ... Hash: SHA1 ... So the above function's loop goes over these many times ... inserting the rules for each range. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: [Maxima] Bug in for, Maxima, Debian ?
    ... ans = ... I got empty matrix it is correct. ... This loop shouldn't execute, but this loop go forever writing: ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Cracking SSL passwords for fun and profit
    ... file the current loop variables, and load them on startup if given the ... OpenSSL, it was designed _not_ to accept passwords from the ... openssh is not the only ssh client in Debian. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: iceape puzzle
    ... There's another process doing things with dpkg at the time this loop happens. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)