Sponsored Content
Top Forums Shell Programming and Scripting Script for Deleting a process which exist every day in hold state Post 302947375 by jim mcnamara on Wednesday 17th of June 2015 02:29:56 PM
Old 06-17-2015
I edited your code - but if you ran the code as a one-liner it would never work as written.
Please check that my edit renders you code correctly because there are still errors.

Please tell us what error you get. Plus I do not know the del command which is possible if it is an alias or something new for your OS or part of direct.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Process State

If your process makes a system call, then while the system call code is being run in the kernel, is your process READY, RUNNING or BLOCKED? (1 Reply)
Discussion started by: ianlow
1 Replies

2. Solaris

Kill a particular process if it's over an hour hold

I meant old not hold :) I need to kill a process if it's over an hour old and then send an e-mail of the list that was killed.....? I need to kill ps -ef | grep stashd | grep ' older than an hour?' #! /bin/bash if test ps -ef | grep <stashd> (Is over an hour old)???? >>stashd_old.txt ... (9 Replies)
Discussion started by: xgringo
9 Replies

3. Shell Programming and Scripting

Unix script (sh): state of ftp process

Hi guys, I'm writing a script in which I have to get file from a remote host by ftp. The problem is that the remote machine could be very slow, not connected or ok. To resolve this problem, I write this: echo "verbose on" > ftprap.cmd echo "prompt " >> ftprap.cmd echo "ascii"... (3 Replies)
Discussion started by: egiz81
3 Replies

4. UNIX for Advanced & Expert Users

When a process will go to 'D' state?

I'm using "Linux hostname 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686 GNU/Linux" All the client machines will use Thin-client ,I will use my laptop for working and I will mount my home directory from server to my laptop. If I open the firefox in my laptop the... (1 Reply)
Discussion started by: ungalnanban
1 Replies

5. Shell Programming and Scripting

Script to Kill process which is in hang state

Hi, Can anyone help to create a script that will kill the process which is in hang state. (1 Reply)
Discussion started by: A.Santhosh
1 Replies

6. Shell Programming and Scripting

Deleting the lines exist between the Mattched Patterns

Hi, I have a file with the content: for name in \ sree\ rama\ laila\ srihari\ vicky\ john do echo $name done I need to remove all the name lines that exist between for (first line) and do line so that i can replace with new names. Output file should look like: (3 Replies)
Discussion started by: raosr020
3 Replies

7. Shell Programming and Scripting

Problem with a script for checking the state of a process

Hello Everyone, I have a process that should be always running. Unfortunately, this process is getting down almost every 10 minutes. I want to make a script that verify the state of this process: If the process is up, the script shouldn't do nothing and if it's down he should run it. Can... (3 Replies)
Discussion started by: adilyos
3 Replies

8. BSD

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (0 Replies)
Discussion started by: naveeng
0 Replies

9. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (1 Reply)
Discussion started by: naveeng
1 Replies

10. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (6 Replies)
Discussion started by: naveeng
6 Replies
edinplace(1)							Mail Avenger 0.8.3						      edinplace(1)

NAME
edinplace - edit a file in place SYNOPSIS
edinplace [--error=code] [[--file=file] command [arg ...]] DESCRIPTION
edinplace runs command with its input from file (or standard input by default), and then replaces the contents of file with the output of command. To the extent possible, edinplace attempts to exit with the same status as command. If edinplace is run on standard input (no --file option), it must inherit a file descriptor 0 that is open for both reading and writing. When processing standard input, if edinplace does not encounter a fatal error, it rewinds its standard input to offset 0 before exiting. Thus, a script can first run edinplace command, then run another filter command such as grep, and the resulting output will be the output of grep on command's output. If no command is specified, edinplace just rewinds its standard input to file offset 0. In this case, it is an error to supply the --file option. Of course, rewinding only works when standard input is a real file (as opposed to a pipe or device). There are two options: --error=code (-x code) Ordinarily, edinplace attempts to exit with the same status as command. However, if edinplace encounters some fatal error (such as being unable to execute command), it will exit with status code. The default value is 1. The range of valid exit codes is 1-255, inclusive. --file=file (-f file) Specifies that file should be edited. Otherwise, edinplace will edit its standard input (which must be opened for both reading and writing). --skipfrom Skip the first line of the file if it starts "From ". If edinplace is run without a command, positions the file offset at the start of the second line of the file. If edinplace is run with a command, then the first line of the file is neither fed to the command, nor overwritten. This option is useful for running edinplace over mail files, which sometimes start with a "From " line specifying the envelope sender of the message. Since "From " is not part of the message header, just a Unix convention, some programs are confused by the presence of that line. Note that if you specify a command, then edinplace resets the file offset to 0 upon exiting, even if the --skipfrom option was present. EXAMPLES
The following command prepends the string "ORIGINAL: " to the beginning of each line in text file message: edinplace -f message sed -e 's/^/ORIGINAL: /' The following command runs the spamassassin mail filter program on a mail message stored in file message, replacing the contents of message with spamassassin's annotated output, and exiting with code 100 if spamassassin thinks the message is spam. If edinplace encounters any fatal errors, it will exit with code 111. edinplace -x 111 -f message spamassassin -e 100 (spamassassin reads a mail message on standard input and outputs an annotated copy of the message including information about whether or not the message is likely to be spam and why. The -e option to spamassassin specifies what exit status spamassassin should use if the message appears to be spam; edinplace will use the same exit code as the program it has run.) To run spamassassin on incoming mail before accepting the mail from the remote client, place the following line in an appropriate Mail Avenger rcpt file as the last command executed: bodytest edinplace -x 111 spamassassin -e 100 SEE ALSO
avenger(1) The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
edinplace does not make a copy of the file being edited, but rather overwrites the file as it is being processed. At any point where command has produced more output than it has consumed input from the file, edinplace buffers the difference in memory. Thus, a command that outputs large amounts of data before reading the input file can run edinplace out of memory. (A program that outputs data as it reads even a very large file should be fine, however.) If command crashes or malfunctions for any reason, you will likely lose the input file, since edinplace will view this as a program that simply outputs the empty file. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 edinplace(1)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy