Closing information to stdout‏


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Closing information to stdout‏
# 1  
Old 11-19-2010
Closing information to stdout‏

Hi Guys,

I have a shell script that is being uploaded through the xterm command in a *.scr file. In my shell script I'm using a tool (zap command) for closing windows, eg. xgraph windows. I'm using the following command to avoid getting the closing information in my scr window:

Code:
zap xgraph 2>/dev/null

However, it still appears in my scr window. I thought this could do the trick but doesn't work as I expected. I'd be very grateful if some suggestions or hints could be provided to improve (or change) the above line command to avoid the closing information.

Thanks in advance,

Cheers,
# 2  
Old 11-19-2010
truss or tusc or strace can tell you what it is writing. If stdout, use >/dev/null. If /dev/tty, maybe see man nohup.
# 3  
Old 11-19-2010
Im not familiar with zap, but I'm guessing it's writing to standard out rather than stderr. Try this:

Code:
zap xgraph >/dev/null 2>&1

Which redirects both stdout and stderr to /dev/null.
# 4  
Old 11-20-2010
See if this works:
Code:
( zap xgraph 2>/dev/null )

or perhaps you need to suppress stdout too...
Code:
( zap xgraph 2>/dev/null >&2 )

# 5  
Old 11-20-2010
Thank you guys for your ideas, however I'm still getting the closing information. This is what I got:

Code:
...
... 
 1 = go to the menu     2 = exit the script 
 
2
./sdp.sh: line 6142:  2084 Killed                  suxwigb key=$key perc=$perc xbox=725 ybox=10 wbox=710 hbox=865 label1="TWT [s]" label2="$key" title="Wiggles of $su" windowtitle="Wiggles of $su" va=4 xcur=5 verbose=0 < $su
./sdp.sh: line 6142:   528 Killed                  suximage key=$key perc=$perc xbox=10 ybox=10 wbox=710 hbox=865 label1="TWT [s]" label2="$key" title="VD of $su" windowtitle="VD of $su" verbose=0 legend=1 units=Amplitude < $su

Any additional idea is appreciated,

Thanks again

---------- Post updated at 08:51 AM ---------- Previous update was at 08:13 AM ----------

Guys, this does what I want:

Code:
killall xgraph

After this, I don't receive any kind of messages.

Thanks for your support.

Cheers,

Gery
# 6  
Old 11-20-2010
Maybe terminate them with something that does not log, like a caught signal and exit?

Of run them with the logging redirected to an appropriate, dedicated log file?

One trick to not hear from your children is to make them orphan grandchildren by starting them in a subshell (). For instance, as I recall this does not tell you the pid or exit:
Code:
(
for f in *
do
 fgrep -l DeWoid $f &
done
)

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Closing thread

Hi, I guess, users do not have rights to close a thread. Please close thread 'Small automation' as it is resolved. Regards, snjksh (1 Reply)
Discussion started by: snjksh
1 Replies

2. Red Hat

Installing EBS 12.1.1 on RHEL 6.1 x86_64‏

i am in process to install R12.1.1 on RHEL 6.1. while installing pre-requisite on RHEL 6.1 i am facing following error : rpm -ivh xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386.rpm error: Failed dependencies: libX11.so.6 is needed by xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386 ... (3 Replies)
Discussion started by: rehantayyab82
3 Replies

3. What is on Your Mind?

AllTheWeb closing

It was officially announced that AllTheWeb is closing. Yahoo! no longer supports the function as per april 2011: AlltheWeb.com Before the world turned to google by default, there used to be a plethora of search engines. Most of them gave a headache with the prolific use of colors and animated gifs... (4 Replies)
Discussion started by: figaro
4 Replies

4. UNIX for Advanced & Expert Users

Build catalogue for sliced dar archive‏

Hi I have a use case where I use Dar to backup a huge filesystem into 4GB slices and build catalogue for incremental backup later. Since I don't have enough space for all slices, I have to upload one slice to target server and delete, and then generate another slice... (using something like... (0 Replies)
Discussion started by: overmindxp
0 Replies

5. Post Here to Contact Site Administrators and Moderators

Thread Closing

Not sure as to How to close a thread so people understand that the issue was solved and the issue is not just sitting in limbo still waiting for a resolution. (1 Reply)
Discussion started by: mrmurdock
1 Replies

6. IP Networking

Closing the socket

Hi, I have a question on closing the listen socket in server. In the application I am working, the server is continously receiving requests from the client in its master socket to handle each request. There is an option to shutdown the server process. In this case do I need to explicitly close... (1 Reply)
Discussion started by: naan
1 Replies

7. Shell Programming and Scripting

closing windows

Ok i know to open a window from a script (mac); open whatever(name of a directory) but i don't how to close it. please some help. thanks. (0 Replies)
Discussion started by: Tártaro
0 Replies

8. Post Here to Contact Site Administrators and Moderators

Closing a thread

hi, Just wondering if there could be a way to close threads whose creator has got the desired reply. however if someone still wants to give a remark or suggest further on the thread one can still do so. Besides on the control panel there should be some kind of selection criteria to view... (3 Replies)
Discussion started by: linuxpenguin
3 Replies

9. IP Networking

Closing out ports???

Hi all Is there a command that I can use to close out open ports? I did a netstat - a -p and got a long list of ports open (see sample below). I have disabled the some of the applications from /etc/services/. But there are still applications listening on certain ports. I need to know how to... (6 Replies)
Discussion started by: skotapal
6 Replies
Login or Register to Ask a Question