Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stupid shell stuff: prepending a character on each line



oops sorry for the duplicate answer.  the way gmail groups things sometimes
i get a bit lost.  i'll try to be first on the next bash problem  :)
- eric.

On Sat, Jan 9, 2010 at 8:32 PM, eric chadbourne
<eric.chadbourne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>wrote:

> sed -i 's/^/'.'/' your_file.txt
>
> i've worked on an old sunos box that didn't have the '-i' command but if
> you're on linux you should be fine.
>
> - eric c.
> http://www.linkedin.com/in/echadbourne
>
> On Sat, Jan 9, 2010 at 7:02 PM, Don Levey <lug-TwWeWiF2EGRi+ztankeudA at public.gmane.org> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I'm trying to set up a proxy server at home, and make use of
>> externally-prepared lists of sites to restrict.  Each list comes one
>> site to a line, in the form "example.com" (no quotes, of course).
>>
>> The problem here is that for whatever reason squid doesn't like that
>> format.  However, if I use ".example.com" with the initial dot, all is
>> well with the world.  I've got things set up now so that each external
>> list is downloaded, placed in the proper directory, and unzipped;
>> apparently, I been to prepend the "." to each line.
>>
>> I'm sure something like sed or awk could do something like this, but my
>> experience with them is limited to being able to spell them.  Does
>> anyone have any suggestions for how I might accomplish this?  I'd prefer
>> to keep the files in-place, but if I need to simply read the file line
>> by line, cat the dot to each line, and output elsewhere then so be it.
>>
>> Thanks!
>>  -Don
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.7 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iD8DBQFLSRkCiVR8AmYXiFARAv10AJ45GexLlywltiKEkSLdJFDo+OJZGACghaUX
>> 66SU20bsn8Cq+b/4OsRIMIY=
>> =Zd5E
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> Discuss mailing list
>> Discuss-mNDKBlG2WHs at public.gmane.org
>> http://lists.blu.org/mailman/listinfo/discuss
>>
>
>






BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org