Sponsored Content
Operating Systems HP-UX Suppressing errors from command output Post 303017223 by gull04 on Friday 11th of May 2018 04:10:31 AM
Old 05-11-2018
Hi,

The script expects to see the resolve.conf file, so is correctly identifying the missing file - touching the file removes the error.

There are a number of options, the simplest is probably to do;

Code:
touch /etc/resolv.conf
chmod 440 /etc/resolv.conf

Alternatively you could send the stderr to /dev/null

Your final option would be to modify the script and put the offendin part of the script inside a test condition - running if the resolv.conf file exists.

Regards

Gull04
This User Gave Thanks to gull04 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

redirecting output, including errors

what's the proper syntax to redirect output, including all errors? ls -la > direct.list makes out put file direct.list but if i'm running a script and i want to include the errors, would i type something like: myscript.scr 2> out_list.txt or will that get the errors only? (1 Reply)
Discussion started by: kymberm
1 Replies

2. UNIX for Dummies Questions & Answers

Suppressing output to the screen

I want to check whether the variable read from the console is number or character , so i used echo $option|grep and checked the reuslt returned by grep cmd using $? But since I use echo the value is getting printed in the screen , I want to supress the o/p. Can anyone suggest how this can be... (1 Reply)
Discussion started by: rolex.mp
1 Replies

3. UNIX for Dummies Questions & Answers

suppressing an error message using the "ls" command

hi I'm new here so my question maybe be retarded or out of place: Is there a way to suppress the "No such file or directory" error message when using the "ls" command ? thanks (5 Replies)
Discussion started by: basher400
5 Replies

4. Programming

popen catching output and errors

I have code which at the moment only catches the command/program output if the program runs correctly, which is a small problem as I would like to capture everything from stdout inclusive of errors FILE *fp; fp = popen(command.c_str(), "r"); while(fgets(cbuf, 1024, fp) != NULL){ .....do stuff... (1 Reply)
Discussion started by: mshindo
1 Replies

5. Shell Programming and Scripting

Suppressing the automatic output of "script"

Is there a way to suppress the output that script command displays - "Script command started..." (4 Replies)
Discussion started by: ggayathri
4 Replies

6. Shell Programming and Scripting

Suppressing output of a spawned telnet process

Hi, I'm trying to spawn a telnet process and trying to do some actions in the remote host using expect script. I would like to know how to suppress all the output in order the user using the script should not be able to see any actions done on the remote host. I tried using the "log_user 0"... (8 Replies)
Discussion started by: arun_maffy
8 Replies

7. Shell Programming and Scripting

Need help redirecting output to a file including errors

Need help redirecting output to a file including errors if any,I have 2 script namely push.ksh and run.ksh, I'm scp'ing push.ksh to another server and executing remotely via run.ksh, the script run.ksh runs locally but does not capture any errors in "servername.out" file (I tried testing various... (10 Replies)
Discussion started by: mbak
10 Replies

8. HP-UX

errors from output /usr/bin/last

for ga016dgf -> /usr/bin/last | cut -c1-3 Invalid record size. Unable to continue ... any ideas? running on ga016dgf -> uname -a HP-UX ga016dgf B.11.31 U ia64 1246079591 unlimited-user license thank you. Video tutorial on how to use code tags in The UNIX and Linux Forums. (4 Replies)
Discussion started by: Bill L.
4 Replies

9. Shell Programming and Scripting

sending mail in perl.. No errors and also no output

Hi folks, I am trying to send an email in Perl script with the below code. I have written the code in Padre IDE and installed all the required modules(Mail::Sendmail) and executed the code. It is neither showing errors nor giving the output. I havnt received an mail after running the below... (1 Reply)
Discussion started by: giridhar276
1 Replies

10. Programming

Python tar script; no errors; no output

This script produces no errors. It also does not produce an output file. Any ideas? #!/usr/bin/python import tarfile output_filename = 'etc.tar' source_dir = '/etc/' #To build a .tar.gz for an entire directory tree: def make_tarfile(output_filename, source_dir): with... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies
res_init(3)						     Library Functions Manual						       res_init(3)

NAME
res_init - Searches for a default domain name and Internet address LIBRARY
Standard C Library (libc.a, libc.so) SYNOPSIS
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> void res_init ( void ); DESCRIPTION
The res_init() function reads the /etc/resolv.conf file for the default domain name and the Internet address of the initial hosts running the name server, even if the name server is not functioning. The res_init() function is one of a set of subroutines that form the resolver, a set of functions that resolve domain names. All resolver functions use the /usr/include/resolv.h header file, which defines the _res data structure. The res_init() function stores domain name information in the _res data structure. NOTES
If the /etc/resolv.conf file does not exist, the res_init() function attempts name resolution using the local /etc/hosts file. If the sys- tem is not using a domain name server, the /etc/resolv.conf file should not exist. The /etc/host file should be present on the system even if the system is using a name server. In this instance, the file should contain the host IDs that the system requires to function even if the name server is not functioning. FILES
Contains the name server and domain name. Contains hostnames and their addresses for hosts in a network. This file is used to resolve a hostname into an Internet address. RELATED INFORMATION
Functions: dn_comp(3), dn_expand(3), dn_find(3), dn_skipname(3), _getlong(3), _getshort(3), putlong(3), putshort(3), res_mkquery(3), res_query(3), res_search(3), res_send(3). delim off res_init(3)
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy