[98779] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: A script problem

daemon@ATHENA.MIT.EDU (Zoki)
Tue Nov 10 17:21:59 1998

Date: Tue, 10 Nov 1998 13:09:55 +0100 (CET)
From: Zoki <zokiphoto@magic.fr>
To: redhat-list@redhat.com
In-Reply-To: <364784FF.94C5368B@iname.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

On Mon, 9 Nov 1998, Jan Carlson wrote:

->"Anthony E. Greene" wrote:

<snip>

->>         USER='/usr/bin/id -un'
->
->No, because USER already has this value.
->Bash maintains it for you.


*** This is a very good point. I checked and it's maintained by a line in
/etc/profile so I just use $USER in the if statement. The script works now
and I implemented it with success. I needed it to make it part of a script
I started working on to give the console some sort of a trash bin. The
point was to test which user is using the trash script and accordingly
deposit the trashed file into its bin (stocking space). At this point in
time the script works from the dir you're in, lists the contence and
allows you to enter the name of the file to be trashed. Next, it tar's,
zip's, deposit's the trashed file into the bin and deletes the original
file. <pride> It also works on directories and very well I might add!
</pride> I finished also a purge script and I'm working on a restore
script at the moment. While there're two alternatives giving the console a
trash bin, the first is very simple and just stocks files into a dir. It
doesn't tar & zip them so they take a lot of space (big files are just
moved to another place) and restoring is also a pain because it doesn't
keep a trace of where they come from (mine tar's with pP option) and it
mixes them with the files already present in the stocking space. The
second alternative more elaborated but it needs compiling, installing and
a lot of configuring. It changes a lot and messes around too much with
system files. Accidentally it didn't work on my system and it seems it's
not being updated anymore. So, stubornly I decided to do one myself and it
seems to go the right way. Right now I'm looking at how the files could be
restored to their original location without having to untarzip them from
/. Another thing I'll have to figure out is how to make the script accept
new user accounts automatically. At this point the script has to be
configured manually so it's okay on a workstation but wouldn't work in a
surrounding where there're more than 1 user and new ones coming and going.

Cheers and thanks for the feedback,
Zoki.
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/
ZOKImage Paris
	Creation d'images est traitement numerique
			Image creation & digital tweaking
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/

Mailed with Linux and Pine.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
		http://www.redhat.com http://archive.redhat.com
         To unsubscribe: mail redhat-list-request@redhat.com with 
                       "unsubscribe" as the Subject.


home help back first fref pref prev next nref lref last post