Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Adding text to the beginning of a file
- Date: Sat, 17 Mar 2007 12:31:09 -0400
- From: Scott Robbins <scottro@example.com>
- Subject: Re: [tlug] Adding text to the beginning of a file
- References: <45FA6B45.3040500@example.com> <ba75897e0703160413oc5219d7gb2bea3d53cd0afc2@example.com> <45FB452B.8050205@example.com> <ba75897e0703162026gb5fec8cm94470f4e30b117c4@example.com> <17915.55760.452640.548230@example.com> <20070317122958.GM13829@example.com> <20070317132851.GA77091@example.com> <20070317153015.GO13829@example.com>
- User-agent: mutt-ng/devel-r804 (FreeBSD)
On Sun, Mar 18, 2007 at 12:30:15AM +0900, Edward Wright wrote: > On Sat, Mar 17, 2007 at 09:28:51AM -0400, Scott Robbins wrote: > > > export IFS=$'\n' > > > for file in `ls`;do echo $file; done > > > > I didn't know that one. I do find that setting it null also works > > > > export IFS="" > > Hmm. Yeah, it does, but I don't get why. I would expect no "separating" > to take place in that case. Do you mean that you think it would have just listed everything as one long file name? I would guess that ls has other means of figuring what is a different file. (Of course, if ls' method of differentation was perfect, we wouldn't have to do tricks with spaces in the file name.) :) However, I don't really grok IFS very well at all--with me, it's usually trial and error when I try to use it. > > Doing a little research turned up the fact that if IFS is not set, it > behaves differently than if it is set with no value. (In that case it > reverts to the default <space><tab><newline> behavior.) That would be expected I think. (I'm afraid of getting deeply into this discussion as I fear I'll show a great deal of ignorance.) > > > With yours, I found that mistyping, and leaving out the $ set n as the > > separator. > > > > > > export IFS='\n' [note the typo] > > This sets the field separators to backslash and 'n'. If you had a file > name with a backslash in it, it would also be split. > > try touch ab\\cd Yup, it did the same thing ab cd Thanks. -- Scott Robbins PGP keyID EB3467D6 ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 ) gpg --keyserver pgp.mit.edu --recv-keys EB3467D6 Whistler: Bottom line is, even if you see them coming, you're not ready for the big moments. No one asks for their life to change, not really. But it does. So, what are we, helpless? Puppets? Nah. The big moments are gonna come, you can't help that. It's what you do afterwards that counts. That's when you find out who you are.
- References:
- [tlug] Adding text to the beginning of a file
- From: Dave M G
- Re: [tlug] Adding text to the beginning of a file
- From: Arwyn Hainsworth
- Re: [tlug] Adding text to the beginning of a file
- From: Dave M G
- Re: [tlug] Adding text to the beginning of a file
- From: Arwyn Hainsworth
- Re: [tlug] Adding text to the beginning of a file
- From: Stephen J. Turnbull
- Re: [tlug] Adding text to the beginning of a file
- From: Edward Wright
- Re: [tlug] Adding text to the beginning of a file
- From: Scott Robbins
- Re: [tlug] Adding text to the beginning of a file
- From: Edward Wright
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Adding text to the beginning of a file
- Next by Date: Re: [tlug] Adding text to the beginning of a file
- Previous by thread: Re: [tlug] Adding text to the beginning of a file
- Next by thread: Re: [tlug] Adding text to the beginning of a file
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links