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: Fri, 16 Mar 2007 23:05:44 -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>
- User-agent: mutt-ng/devel-r804 (FreeBSD)
On Sat, Mar 17, 2007 at 10:32:27AM +0900, Dave M G wrote: > Arwyn, > > 1. Can I use cat to prepend the contents of a variable in the shell script? I > tried this: > TEXT="This is text" > cat $TEXT temp.file >> new.file Rather than cat I think you want echo for a variable. The cat command will echo the contents of a file cat $TEXT (in zsh, behavior will be similar in others) this is text no such file or directory. echo $TEXT this is text echo $TEXT > file1; cat file1. In your case, a very kludgy way to do it might be echo $TEXT > new.file; cat temp.file >> new.file -- Scott Robbins PGP keyID EB3467D6 ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 ) gpg --keyserver pgp.mit.edu --recv-keys EB3467D6 Cordelia: Hi! You having fun? Angel: Sure. This is, uh... Cordelia: Your idea of hell. Angel: Actually, in hell you tend to know a lot of the people
- 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
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