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: Sun, 18 Mar 2007 00:30:15 +0900
- From: Edward Wright <edw@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>
- User-agent: Mutt/1.4i
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. 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.) > With yours, I found that mistyping, and leaving out the $ set n as the > separator. > > touch 1 2 3 "stupid file name" > > 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 Ed
- Follow-Ups:
- 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
- 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
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] get free local port for script?
- Next by Date: Re: [tlug] get free local port for script?
- 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