Sponsored Content
Top Forums Shell Programming and Scripting Script for Deleting a process which exist every day in hold state Post 302947238 by Phani369 on Tuesday 16th of June 2015 03:27:24 PM
Old 06-16-2015
Code:
sudo -iu  root/opt/app/root/cdlinux/ndm/bin/direct <<EOF
read status
read number
status=$(sel proc);
if[("$status " == Select Process Completed Successfully ]
then
exit
else
number=$(awk '{print $2}')
del proc $number;
echo "process deleted successfully"
fi
EOF

Is this code is correct ? select process completed successfully is the message I will get if no one process is in hung state

please guide me

Thank you so much for quick response

Last edited by rbatte1; 06-17-2015 at 08:27 AM.. Reason: Added ICODE tags.
 

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
XCODE-SELECT(1) 					    BSD General Commands Manual 					   XCODE-SELECT(1)

NAME
xcode-select - Manages the active developer directory for Xcode and BSD tools. SYNOPSIS
xcode-select [-h|--help] [-s|--switch <path>] [-p|--print-path] [-v|--version] DESCRIPTION
xcode-select controls the location of the developer directory used by xcrun(1), xcodebuild(1), cc(1), and other Xcode and BSD development tools. This also controls the locations that are searched for by man(1) for developer tool manpages. This allows you to easily switch between different versions of the Xcode tools and can be used to update the path to the Xcode if it is moved after installation. Usage When multiple Xcode applications are installed on a system (e.g. /Applications/Xcode.app, containing the latest Xcode, and /Applica- tions/Xcode-DP.app containing a developer preview) use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools. After setting a developer directory, all of the xcode-select provided developer tool shims (see FILES) will automatically invoke the ver- sion of the tool inside the selected developer directory. Your own scripts, makefiles, and other tools can also use xcrun(1) to easily lookup tools inside the active developer directory, making it easy to switch them between different versions of the Xcode tools and allow- ing them to function properly on systems where the Xcode application has been installed to a non-default location. OPTIONS
-h, --help Prints the usage message. -s <path>, --switch <path> Sets the active developer directory to the given path, for example /Applications/Xcode-DP.app. This command must be run with supe- ruser permissions (see sudo(8)), and will affect all users on the system. To set the path without superuser permissions or only for the current shell session, use the DEVELOPER_DIR environment variable instead (see ENVIRONMENT). -p, --print-path Prints the path to the currently selected developer directory. This is useful for inspection, but scripts and other tools should use xcrun(1) to locate tool inside the active developer directory. -r, --reset Unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism. This command must be run with superuser permissions (see sudo(8)), and will affect all users on the system. -v, --version Prints xcode-select version information. --install Opens a user interface dialog to request automatic installation of the command line developer tools. ENVIRONMENT
DEVELOPER_DIR Overrides the active developer directory. When DEVELOPER_DIR is set, its value will be used instead of the system-wide active developer directory. Note that for historical reason, the developer directory is considered to be the Developer content directory inside the Xcode applica- tion (for example /Applications/Xcode.app/Contents/Developer). You can set the environment variable to either the actual Developer con- tents directory, or the Xcode application directory -- the xcode-select provided shims will automatically convert the environment vari- able into the full Developer content path. EXAMPLES
xcode-select --switch /Applications/Xcode.app/Contents/Developer Select /Applications/Xcode.app/Contents/Developer as the active developer directory. xcode-select --switch /Applications/Xcode.app As above, selects /Applications/Xcode.app/Contents/Developer as the active developer directory. The Developer content directory is auto- matically inferred by xcode-select. /usr/bin/xcodebuild Runs xcodebuild out of the active developer directory. /usr/bin/xcrun --find xcodebuild Use xcrun to locate xcodebuild inside the active developer directory. env DEVELOPER_DIR="/Applications/Xcode-DP.app" /usr/bin/xcodebuild Execute xcodebuild using an alternate developer directory. FILES
/usr/bin/xcrun Used to find or run arbitrary commands from the active developer directory. See xcrun(1) for more information. /usr/bin/agvtool /usr/bin/desdp /usr/bin/ibtool /usr/bin/ictool /usr/bin/instruments /usr/bin/iprofiler /usr/bin/opendiff /usr/bin/sdef /usr/bin/sdp /usr/bin/xcodebuild /usr/bin/xed Runs the matching Xcode tool from with the active developer directory. /usr/bin/BuildStrings /usr/bin/CpMac /usr/bin/DeRez /usr/bin/GetFileInfo /usr/bin/MergePef /usr/bin/MvMac /usr/bin/ResMerger /usr/bin/RezDet /usr/bin/RezWack /usr/bin/Rez /usr/bin/SetFile /usr/bin/SplitForks /usr/bin/UnRezWack /usr/bin/ar /usr/bin/as /usr/bin/asa /usr/bin/bison /usr/bin/c89 /usr/bin/c99 /usr/bin/clang++ /usr/bin/clang /usr/bin/cmpdylib /usr/bin/codesign_allocate /usr/bin/cpp /usr/bin/ctags /usr/bin/ctf_insert /usr/bin/dsymutil /usr/bin/dwarfdump /usr/bin/flex++ /usr/bin/flex /usr/bin/g++ /usr/bin/gatherheaderdoc /usr/bin/gcc /usr/bin/gcov /usr/bin/git-cvsserver /usr/bin/git-receive-pack /usr/bin/git-shell /usr/bin/git-upload-archive /usr/bin/git-upload-pack /usr/bin/git /usr/bin/gm4 /usr/bin/gnumake /usr/bin/gperf /usr/bin/hdxml2manxml /usr/bin/headerdoc2html /usr/bin/indent /usr/bin/install_name_tool /usr/bin/ld /usr/bin/lex /usr/bin/libtool /usr/bin/lipo /usr/bin/lldb /usr/bin/lorder /usr/bin/m4 /usr/bin/make /usr/bin/mig /usr/bin/mkdep /usr/bin/nasm /usr/bin/ndisasm /usr/bin/nm /usr/bin/nmedit /usr/bin/otool /usr/bin/pagestuff /usr/bin/ranlib /usr/bin/rebase /usr/bin/redo_prebinding /usr/bin/resolveLinks /usr/bin/rpcgen /usr/bin/segedit /usr/bin/size /usr/bin/strings /usr/bin/strip /usr/bin/svn /usr/bin/svnadmin /usr/bin/svndumpfilter /usr/bin/svnlook /usr/bin/svnserve /usr/bin/svnsync /usr/bin/svnversion /usr/bin/unifdef /usr/bin/unifdefall /usr/bin/xml2man /usr/bin/yacc Runs the matching BSD tool from with the active developer directory. SEE ALSO
xcrun(1) HISTORY
The xcode-select command first appeared in Xcode 3.0. Mac OS X July 30, 2013 XCODE-SELECT(1)
All times are GMT -4. The time now is 12:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy