11-25-2005
creating a menu for recycling and permanently deleting files.
Trying to alias rm to move files to a hidden trash directory in the bash shell. I've tried to create this alias numberous ways and it's just not working. Here's what I've tried, anyone have any suggestions.
alias rm='mv $* ~/.trash'
alias rm= 'mv$* ~/.trash'
things like that... I've also tried creating a function called my_rm_script that contains just the "'mv ..." part of the above.
None of it works! I've about lost patience with it.
The concept is to create an undelete function:
an alias for rm to place "deleted" files in a trash folder
give an option to recover files from the trash folder
and
a destroy function that basically unaliases rm briefly so that the files that are chosen to be deleted are permanently deleted from the ~/.trash folder.
Help Please?!?!?!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
I have the following function ,which generates menu for installation type:
select_install_type()
{
echo
echo ========================================
echo Please select the type of installation:
echo ========================================
... (8 Replies)
Discussion started by: nir_s
8 Replies
2. UNIX for Dummies Questions & Answers
hi all, any ideas how we can permanently modify the open files?
bash-2.03$ ulimit -a
core file size (blocks) 0
data seg size (kbytes) unlimited
file size (blocks) unlimited
open files 256 <---------------
pipe size (512 bytes) 10
stack size... (2 Replies)
Discussion started by: 3rr0r_3rr0r
2 Replies
3. Shell Programming and Scripting
I am very new to Unix and know the basic commands. I have to write a script file and I'm completely lost. The script file is to show the following at the beginning:
Menu of Options
1. Display all files in a user's home directory.
2. Welcome yourself to the program.
3. Display System... (8 Replies)
Discussion started by: sinjin
8 Replies
4. Shell Programming and Scripting
Hi
I am wanting to create a menu that will list all the log files in a specific directory such as /apps/logs.
So it would be something like this:
#!/bin/ksh
print 'Select The Required Log File'
PS3='log? '
select choice in <this is to contain a list of files that are in a directory that... (3 Replies)
Discussion started by: markrj
3 Replies
5. Shell Programming and Scripting
Hi,
I need your help co create a very small menu somthing that look like this:
1. first step
2. second step
3. last step
from step : ___
to step : ___
If the user choose 1 --> it will echo : Hellow
If the user choose 2 --> it will echo : World
If the user choose 3 --> it will echo... (4 Replies)
Discussion started by: yoavbe
4 Replies
6. UNIX for Advanced & Expert Users
hi.........
can anyone suggest me how n where can i find the module used for recycling logs in Unix(some .so file is used i suppose).till date i have done it with scripting but maintaining the script is becoming difficult.
many2 thanx in advance
-manuj (2 Replies)
Discussion started by: manuj upadhyay
2 Replies
7. AIX
Had a bizzare problem last night with one of our tools running on an AIX server that has not come up before. The tool has been in use for over a year without this problem showing up.The tool basically does this: -Kick off a background task and record the PIDGo and do a bunch of other taskswait for... (4 Replies)
Discussion started by: steadyonabix
4 Replies
8. Web Development
Hello everyone...I am very new to UNIX hence needs your help in below.
i have written a script to change some configuration in property files and its working fine.but to reflect that change at the application i want to recycle WAS and ihs.i.e. run below start and stop commands at /usr/local/bin ... (2 Replies)
Discussion started by: Sanaa
2 Replies
9. Shell Programming and Scripting
Hi Master of masters,
Thanks for ur reply.
Need ur help for following. Is it possible to create menu for following in linux or a function.
> Look in logs > Status > Action > End Action
> CONFSUCCESS > Success > Show message as successful > Enter to continue
> CONFFAIL > Failure > Show... (1 Reply)
Discussion started by: rajeshwebspere
1 Replies
10. Shell Programming and Scripting
Hey, im fairly new to unix and Im trying to make this unix project that would display a menu and do the following.
MENU
===========================
(p, P) Print users info
(a, A) Add new user
(s, S) Search user
(d, D) Delete user
(x,X) Exit
Enter your choice:
Trying to... (3 Replies)
Discussion started by: ultimaxtrd
3 Replies
LEARN ABOUT DEBIAN
sysprofile
SYSPROFILE(8) System Manager's Manual SYSPROFILE(8)
NAME
sysprofile - modular centralized shell configuration
DESCRIPTION
sysprofile is a generic approach to configure shell settings in a modular and centralized way mostly aimed at avoiding work for lazy sysad-
mins. It has only been tested to work with the bash shell.
It basically consists of the small /etc/sysprofile shell script which invokes other small shell scripts having a .bash suffix which are
contained in the /etc/sysprofile.d/ directory. The system administrator can drop in any script he wants without any naming convention
other than that the scripts need to have a .bash suffix to enable automagic sourcing by /etc/sysprofile.
This mechanism is set up by inserting a small shell routine into /etc/profile for login shells and optionally into /etc/bashrc and/or
/etc/bash.bashrc for non-login shells from where the actual /etc/sysprofile script is invoked:
if [ -f /etc/sysprofile ]; then
. /etc/sysprofile
fi
For using "sysprofile" under X11, one can source it in a similar way from /etc/X11/Xsession or your X display manager's Xsession file to
provide the same shell environment as under the console in X11. See the example files in /usr/share/doc/sysprofile/ for illustration.
For usage of terminal emulators with a non-login bash shell under X11, take care to enable sysprofile via /etc/bash.bashrc. If not set
this way, your terminal emulators won't come up with the environment defined by the scripts in /etc/sysprofile.d/.
Users not wanting /etc/sysprofile to be sourced for their environment can easily disable it's automatic mechanism. It can be disabled by
simply creating an empty file called $HOME/.nosysprofile in the user's home directory using e.g. the touch(1) command.
Any single configuration file in /etc/sysprofile.d/ can be overridden by any user by creating a private $HOME/.sysprofile.d/ directory
which may contain a user's own version of any configuration file to be sourced instead of the system default. It's names have just to
match exactly the system's default /etc/sysprofile.d/ configuration files. Empty versions of these files contained in the $HOME/.syspro-
file.d/ directory automatically disable sourcing of the system wide version.
Naturally, users can add and include their own private script inventions to be automagically executed by /etc/sysprofile at login time.
OPTIONS
There are no options other than those dictated by shell conventions. Anything is defined within the configuration scripts themselves.
SEE ALSO
The README files and configuration examples contained in /etc/sysprofile.d/ and the manual pages bash(1), xdm(1x), xdm.options(5), and
wdm(1x). Recommended further reading is everything related with shell programming.
If you need a similar mechanism for executing code at logout time check out the related package syslogout(8) which is a very close compan-
ion to sysprofile.
BUGS
sysprofile in its current form is mainly restricted to bash(1) syntax. In fact it is actually a rather embarrassing quick and dirty hack
than anything else - but it works. It serves the practical need to enable a centralized bash configuration until something better
becomes available. Your constructive criticism in making this into something better" is very welcome. Before i forget to mention it: we
take patches... ;-)
AUTHOR
sysprofile was developed by Paul Seelig <pseelig@debian.org> specifically for the Debian GNU/Linux system. Feel free to port it to and use
it anywhere else under the conditions of either the GNU public license or the BSD license or both. Better yet, please help to make it into
something more worthwhile than it currently is.
SYSPROFILE(8)