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 acer asus bios bsod computer crash driver drivers error ethernet excel freeze gaming google gpu hard drive hardware hdmi internet laptop malware memory missing monitor motherboard network operating system printer problem ram registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: redirect standard error?

Reply  
Thread Tools
surfnschultz's Avatar
Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 05: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 1,332 posts.
 
Join Date: Feb 2005
Experience: Advanced
23-Feb-2005, 06:31 PM #2
try
Code:
kill -9 $spid 2> /dev/null

Last edited by Headrush; 23-Feb-2005 at 07:08 PM..
surfnschultz's Avatar
Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 07: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.
Reply

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:51 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.