Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Linux and Unix
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop drivers dvd email error excel firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery registry cleaner router screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: redirect standard error?

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
surfnschultz's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 04:35 PM #1
Solved: redirect standard error?
I got this script that puts out an error message and I understand why, but I would prefer to NOT have it go to the screen. How can I redirect in KSH the standard error to /dev/null

Here is my script minus header and config info.

for spid in $(ps -ef | grep "facet "$1 | awk {'print $2'})

do

kill -9 $spid

done
echo All Processes for port $1 have been killed
echo You should be able to login to Dimensions now



I see my two echo requests and they are good, but I get a error since I am killing parent processes, some of the children are gone when it comes to killing them, and I get a error message that reads


kill: 71134: 0403-003 the specified process does not exist

How can I make that go to /dev/null so as not to confuse our users who might use this kill script?

Thanks in advance for any help on this one. OK the race is on will I solve it first?
Headrush's Avatar
Senior Member with 482 posts.
 
Join Date: Feb 2005
Experience: Advanced
23-Feb-2005, 05:31 PM #2
try
Code:
kill -9 $spid 2> /dev/null

Last edited by Headrush : 23-Feb-2005 06:08 PM.
surfnschultz's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 06:04 PM #3
Thanks
Headrush you DA MAN. Thanks. I had the line under the exectued line so of course it was complaining. working well now.
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 09:08 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.