Re: [Bashburn-info] I think I fixed the AUTHOR problem.
Brought to you by:
bashburn
From: Steven W. O. <st...@sy...> - 2008-09-22 02:15:01
|
On Sunday, Sep 21st 2008 at 18:35 -0000, quoth Anders Lind?n: =>Yeah thats pretty much what I meant. Telling the shell which characters =>are to be used to separate fields. => =>Question, why are you setting a new IFS and shortly after set it back to =>the old IFS in loops? =>Is it because programs used in the loop needs the original IFS to work =>properly? Correct. In some cases, it's actually *not* used, but it's good practice to restore IFS right after you're done with it. Sometimes you end up using it and you're not aware of it. I usually lose a few minutes chasing problems when that happens. :-( =>On another note, I noticed when starting the latest svn snapshot of BB, =>it spits out an error message =>that the command die does not exist. I'm guessing because you have not =>sourced the needed file yet at that point. Good catch. Fixed. => => =>On Sun, 2008-09-21 at 18:20 -0400, Steven W. Orr wrote: =>> On Sunday, Sep 21st 2008 at 16:34 -0000, quoth Anders Lind?n: =>> =>> =>Meh, I sent my reply to Steven and not the list. Reposting it here. =>> => =>> =>If I'm not mistaken, IFS is something that is treated as a space or =>> =>newline character no? You can set a character like @, : or | in our case =>> =>to be treated as a whitespace to separate text fields? =>> => =>> =>On Sun, 2008-09-21 at 16:17 -0400, Steven W. Orr wrote: =>> =>> It looks like we have three different values that are being used for IFS. =>> =>> There's the IFS=: which is needed to read a bbrc file. There's IFS=@ used =>> =>> to pass uneval'd data to bbconfmenu. And now there's IFS='|' which is =>> =>> needed to store configure_changes. (BTW, the implication is that a config =>> =>> val may no longer contain an embedded pipe char.) =>> =>> =>> =>> Nick, I hope this works. There's always one guy who screws up and makes =>> =>> people aware that he's good at testing. I consider it a blessing. ;-) The =>> =>> good news is that if you find anything wrong with it, it should be easy to =>> =>> fix. (I try to never let people know that I know how to get the printer =>> =>> working. ;-) =>> =>> =>> =>> On a related topic, I was just curious. Do people understand what IFS is =>> =>> and what I'm doing with it? How it gets restored? etc...? =>> =>> Close. IFS is used as the mechanism to tell bash how to parse text. For =>> example, if I have =>> =>> foo='This is a string: It has some stuff in it. And it's 2:00PM.' =>> then I can say =>> set -- $foo =>> After the set command, =>> $1 will be 'This' =>> $2 will be 'is' =>> $3 will be 'a' =>> and $4 will be 'string:' =>> =>> But if I was to say =>> IFS=: =>> set -- $foo =>> then $1 will be 'This is a string' =>> $2 will be ' It has some stuff in it. And it's 2' =>> and $3 will be '00PM.' =>> =>> In addition, lists will be taken apart differently (for example is for =>> loops, depending on IFS. All the values of IFS that I work with are local =>> copies in subroutines. e.g., =>> =>> subX() =>> { =>> typeset old_IFS="$IFS" =>> typeset IFS="$old_IFS" =>> =>> The default value for IFS is whitespace =>> =>> 533 > echo "$IFS" | od -bc =>> 0000000 040 011 012 012 =>> \t \n \n =>> 0000004 =>> =>> =>-- =>Anders Lind?n =>http://bashburn.sf.net => => =>------------------------------------------------------------------------- =>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge =>Build the coolest Linux based applications with Moblin SDK & win great prizes =>Grand prize is a trip for two to an Open Source event anywhere in the world =>http://moblin-contest.org/redirect.php?banner_id=100&url=/ =>_______________________________________________ =>Bashburn-info mailing list =>Bas...@li... =>https://lists.sourceforge.net/lists/listinfo/bashburn-info => -- steveo at syslang dot net TMMP1 http://frambors.syslang.net/ Do you have neighbors who are not frambors? Steve Orr Who should we vote for? http://steveo.syslang.net/electionrec-2008/ |