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: sindi keesan <keesan AT sdf.lonestar.org>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] bash help; changing case of file names, hyperlinks
  • Date: Sat, 24 Feb 2007 05:17:39 +0000 (UTC)

On Sat, 24 Feb 2007 3aoo-cvfd AT dea.spamcon.org wrote:

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
------------------------------------------

I have proposed this to the people at my list and asked them to make any changes suitable to our system. If the user is running the script from their own directory the script could simply copy the file from my directory to theirs and change the login.

What I want to do is replace keesan with their login name (I was not very clear about this). Would the following do that if run from the user's own directory?

cat ~keesan/procmailrc.sample | sed -e /keesan/`whoami`/ > .procmailrc

cat ~keesan/.forward > .forward

How would I append to existing .procmailrc and .forward instead of replacing/creating them?

To give people the choice of dumping spam with three or more spamassassin points, or saving it to a spam folder, I could write two separate scripts to copy two separate .procmailrc choices.

We lost the staff member who was going to write something up because he got tired of the bickering among other members. The person who helped me with .procmailrc spam filter resigned at the same time. This was shortly after the two bickering members quit. (They had also quit before and asked to come back.) Are all volunteer organizations this ridiculous?

>
Cheers,
Steven

-----------------------
BasicLinux mailing list
-----------------------
http://www.basiclinux.com.ru
http://www.ibiblio.org/pub/linux/distributions/baslinux/
------------------------------------
To exit, send subject=unsubscribe to
baslinux-request AT lists.ibiblio.org


keesan AT sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org




Archive powered by MHonArc 2.6.24.

Top of Page