Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to prevent Accidents 'rm -rf *'? Post 302904308 by Corona688 on Tuesday 3rd of June 2014 12:26:49 PM
Old 06-03-2014
Quote:
Originally Posted by deepakwins
I created the alias, and it would work in unix terminal, but not in the tool.
Aliases only work for interactive users.

This does not mean you should gut and replace your rm command with a script -- that'd be a very bad idea, important system things may use rm.

It means you should fix your tool instead. Adding more conditions would be a good idea.

Is there any possibility for editing the tool itself, or are you stuck with it?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Prevent bash from interpretation :

I am using bash shell; my requirement is to run a long command. Now I have split this long command into a number of shell variables. Some of these shell variables contain special character ':' At the end, when the intended long command is executed as a series of small shell variables the ':'... (7 Replies)
Discussion started by: uday
7 Replies

2. UNIX for Dummies Questions & Answers

Prevent history entry

Is there anyway to prevent a command from being logged in the history file? I share a system with others (log in with same account) and I would like to prevent any passwords from being logged in the history file. Some of the commands that I run require username/password on the command line... (7 Replies)
Discussion started by: here2learn
7 Replies

3. Programming

how to prevent deadlock on this...

I am using linux termios structure to configure serial port and read the port by read function. For some reason, if I read the whole buffer, almost every time the buffer does not contain the correct reply message sequence from a device sending reply to my linux PC. So I use... (5 Replies)
Discussion started by: yimab
5 Replies

4. Shell Programming and Scripting

Prevent output to window

hello, Any suggestion on how to prevent Standard output and Standard Error to window? (3 Replies)
Discussion started by: katrvu
3 Replies

5. Programming

How to prevent a class from inheretance?

:(Hi, There is a class in C++ called "CL". It should not participate in inheretance. If some body inherit it it should give errors.....:( (0 Replies)
Discussion started by: krishna_sicsr
0 Replies

6. UNIX for Advanced & Expert Users

Parallel access - how to prevent

I have one shell script which is being accessed by many jobs at same time. I want to make the script such that , other job should wait for the script if script is being used by some other job. Is there any way to implement it in script level ? Gops (1 Reply)
Discussion started by: Gopal_Engg
1 Replies

7. UNIX for Dummies Questions & Answers

How to prevent queues from disabling themselves

I understand that on my HP-UX 11.31 system when print queues can no longer communicate with remote printers, the queue disables itself. How can I configure it to stop disabling itself, or alternatively, to re-enable itself when the remote printer comes back online? I have users in warehouses who... (6 Replies)
Discussion started by: EatenByAGrue
6 Replies

8. Shell Programming and Scripting

how to prevent process from being killed

Hi,all.Well,I know someone has already asked this question before,however,It's too long before.So i post a new thread here. Here is the issue.I have a shell script that use awk to calculate something and the script takes about 15 mins,it will use 100% CPU,and the system automatically killed the... (2 Replies)
Discussion started by: homeboy
2 Replies

9. Shell Programming and Scripting

How to prevent command from deleted

Hi, I've been searching around for solution, hope that some gurus here can help. I'm using some commands in my shell script and I'd like to protect these command to be moved to another directory. For instance, cp currently in /bin/cp. If I move it to /bin/cpxxx, my script will not be able to... (3 Replies)
Discussion started by: gklntn
3 Replies

10. Emergency UNIX and Linux Support

How to prevent emails as spam?

If an email is sent from our application server(running on AIX) to an id that is outside of the organization like gmail etc, and if gmail should not treat the mail as spam, what has to be done from unix level? (7 Replies)
Discussion started by: ggayathri
7 Replies
MH-DRAFT(5)							     [nmh-1.5]							       MH-DRAFT(5)

NAME
mh-draft - draft folder facility for nmh message system SYNOPSIS
any nmh command DESCRIPTION
There are a number of interesting advanced facilities for the composition of outgoing mail. The Draft Folder The comp, dist, forw, repl, and whom commands have two additional switches, -draftfolder +folder and -draftmessage msg which allow you to manipulate the various draft messages you are composing. If -draftfolder +folder is used, these commands are directed to construct a draft message in the indicated folder. (The "Draft-Folder" profile entry may be used to declare a default draft folder for use with comp, dist, forw, repl, and whom ). If the swith -draftmessage msg is given, the specified draft is used to compose the message. If -draftmessage msg is not used, then the draft defaults to `new' (create a new draft) unless the user invokes comp with -use, in which case the default is `cur'. Hence, the user may have several message compositions in progress simultaneously. Now, all of the nmh tools are available on each of the user's message drafts (e.g. show, scan, pick, and so on). If the folder does not exist, the user is asked if it should be created (just like with refile). Also, the last draft message the user was composing is known as `cur' in the draft folder. Furthermore, the send command has these switches as well. Hence, from the shell, the user can send off whatever drafts desired using the standard nmh `msgs' convention with -draftmessage msgs. If no `msgs' are given, it defaults to `cur'. In addition, all five programs have a -nodraftfolder switch, which undoes the last occurrence of -draftfolder folder (useful if the latter occurs in the user's nmh profile). If the user does not give the -draftfolder +folder switch, then all these commands act "normally". Note that the -draft switch to send and show still refers to the file called `draft' in the user's nmh directory. In the interests of economy of expression, when using comp or send, the user needn't prefix the draft `msg' or `msgs' with -draftmessage. Both of these commands accept a `file' or `files' argument, and they will, if given -draftfolder +folder treat these arguments as `msg' or `msgs'. (This may appear to be inconsistent, at first, but it saves a lot of typing) Hence, send -draftfolder +drafts first is the same as send -draftfolder +drafts -draftmessage first To make all this a bit more clear, here are some examples. Let's assume that the following entries are in the nmh profile: Draft-Folder: +drafts sendf: -draftfolder +drafts Furthermore, let's assume that the program sendf is a (symbolic) link in the user's $HOME/bin/ directory to send. Then, any of the com- mands comp dist forw repl constructs the message draft in the `draft' folder using the `new' message number. Furthermore, they each define `cur' in this folder to be that message draft. If the user were to use the quit option at `What now?' level, then later on, if no other draft composition was done, the draft could be sent with simply sendf Or, if more editing was required, the draft could be edited with comp -use Instead, if other drafts had been composed in the meantime, so that this message draft was no longer known as `cur' in the `draft' folder, then the user could scan the folder to see which message draft in the folder should be used for editing or sending. Clever users could even employ a back-quoted pick to do the work: comp -use `pick +drafts -to nmh-workers` or sendf `pick +drafts -to nmh-workers` Note that in the comp example, the output from pick must resolve to a single message draft (it makes no sense to talk about composing two or more drafts with one invocation of comp). In contrast, in the send example, as many message drafts as desired can appear, since send doesn't mind sending more than one draft at a time. Note that the argument -draftfolder +folder is not included in the profile entry for send, since when comp, et. al., invoke send directly, they supply send with the UNIX pathname of the message draft, and not a -draftmessage msg argument. As far as send is concerned, a draft folder is not being used. It is important to realize that nmh treats the draft folder like a standard nmh folder in nearly all respects. There are two exceptions: First, under no circumstancs will the -draftfolder folder switch cause the named folder to become the current folder. Obviously, if the folder appeared in the context of a standard +folder argument to an nmh program, as in scan +drafts it might become the current folder, depending on the context changes of the nmh program in question. Second, although conceptually send deletes the `msgs' named in the draft folder, it does not call delete-prog to perform the deletion. What Happens if the Draft Exists When the comp, dist, forw, and repl commands are invoked and the draft you indicated already exists, these programs will prompt the user for a reponse directing the program's action. The prompt is Draft ``/home/foobar/nmhbox/draft'' exists (xx bytes). Disposition? The appropriate responses and their meanings are: replace - deletes the draft and starts afresh list - lists the draft refile - files the draft into a folder and starts afresh quit - leaves the draft intact and exits In addition, if you specified -draftfolder folder to the command, then one other response will be accepted: new - finds a new draft just as if -draftmessage new had been given. Finally, the comp command will accept one more response: use - re-uses the draft just as if -use had been given. CONTEXT
None MH.6.8 11 June 2012 MH-DRAFT(5)
All times are GMT -4. The time now is 07:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy