By the way thanks for the reply i solve my problem by just not using a variable i guess csh automatically declare the return values of the previous command as status variable
I used redirection for the stdout and stderr so that no ping result command appears in my script
Last edited by Scott; 12-12-2010 at 06:08 PM..
Reason: Code tags, please...
perl 5.6.1:
when i try a "system" command(with if loops for $?), i get this:
child exited with value 1
what is meant by this $? values and what does it meant if it returns 1?.. (0 Replies)
Hi,
How I can get system function executed command return value ? I want to know mv command success or not ?
#include <stdio.h>
main()
{
int ret;
ret = system( "mv x.dat y.dat" );
printf( "system ret:\n", ret );
} (3 Replies)
Hello
im using sunos and i need to somehow ping other sun in the network but
geting boolean return and not the "sun is alive" response can it be done ? (11 Replies)
I want to write a script in KSH that takes the output of one command and redisplays it. Something like:
while true
do
read inpt
date +"%I:%M:%S %p <-> $inpt"
done
and then some how get the output of the ping command to redirect to the input of this script.
does that make sense? (2 Replies)
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Hi,
I have this script in ksh, what it does is loop every ip in the nodes_nso and produced another variable up_nodes_nso of only ip's that are up.
nodes_nso=$(cat /var/tmp/nodes.txt)
echo "ICMP Tests:"
up_nodes_nso=""
for ip in ${nodes_nso} ; do
ping ${ip} 3 > /dev/null
if ; then
... (1 Reply)
Hi, I want to be able to write a simple program that takes in input from the command line. I;m am at the level of getchar and putchar. Any examples would be a great help thanks.
I intend/prefer also to use the pipe command | eg: input | file1
---------- Post updated at 04:08 PM ----------... (4 Replies)
I want to run
wget "URL" -SO /dev/null 2>&1 | grep "HTTP/\\|Age:\\|Last-Modified:"
but I want a alias so I can just type mywget and the URL and it will put the url in the right place and give me the output that I want without having to type that over and over again.:wall:
I am newbie to all... (2 Replies)
Hi, This is what I have so far but it seems like a lot more than is necessary because....for example...user presses 2 or 3 ..... the script does the *same* thing it just depends on the directory it has to access....how can I improve this so that the code from 2 and 3 is only put once...?
... (4 Replies)
Hi,
I am writing a little script to update a parameters on JMQ. however the JMQ requires a "y" confirmation to be input as part of the cmd I am running. However I want run this script to offline with no input from a user.
it works if a I create a file with with just y in it and pass that in... (3 Replies)
Discussion started by: shropshirehobbi
3 Replies
LEARN ABOUT XFREE86
innetgr
innetgr(1) NSS utilities innetgr(1)NAME
innetgr - Check netgroup membership
SYNTAX
innetgr [-d domain] [-h host] [-u user] [-v] <netgroup>
DESCRIPTION
innetgr checks if the specified user, host or domain is a member of the given netgroup. The program does not produce any output unless the
verbose ( -v ) flag is given.
The exit status is 0 if the user/host/doman combination is a member of the given netgroup. Exit status is 1 if the combination is not
found in the group, and 2 if one of the arguments are invalid.
OPTIONS --domain <domain> | -d <domain>
Search in the given domain.
--host <host name> | -h <host name>
Search for the given host name.
--user <user name> | -u <user name>
Search for the given user name.
--verbose | -v
Enable verbose mode
--version | -V
Show version information.
EXAMPLES
To check if the current host is listed in the netgroup allhosts, use this command line:
if innetgr -h `uname -n` allhosts ; then echo "Found"; fi
CONFORMING TO
A innetgr program first appeared in NetBSD 1.4.
AUTHORS
Petter Reinholdtsen <pere@hungry.com>
SEE ALSO getent(1)netgroup(1)innetgr(3)netgroup(5)nsswitch.conf(5)Petter Reinholdtsen 0.7 innetgr(1)