Skip to Content.
Sympa Menu

baslinux - Re: [BL] bash help; changing case of file names, hyperlinks

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: 3aoo-cvfd AT dea.spamcon.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] bash help; changing case of file names, hyperlinks
  • Date: Sat, 24 Feb 2007 16:58:41 +1300

sindi keesan wrote:
>
> How might I write a script that asks someone to
> type in their login name

echo "Type in your login name"
read answer

> and replaces another string with that in a file?

cat file | sed -e /another string/$answer/ > new-file

> it should also write my filter to their home directory

You can find the name of their home directory by parsing
/etc/passwd. Something like this:
------------------------------------------
cat /etc/passwd|grep ^username|cut -d: -f6
------------------------------------------

Cheers,
Steven




Archive powered by MHonArc 2.6.24.

Top of Page