Outside this process I built a file containing snmp response filtering for hostname, model type and ios version.
I want to get a count across the network of those devices running 11.x code, 12.0 mainline, 12.0 T train and above, 12.1 and above and OS levels.
This works ok .. but its cheap... (2 Replies)
It can get very annoying that bash regex =~ is case-sensetive, is there a way to set it to be case-insensetive?
if ]; then
echo match
else
echo no match
fi (8 Replies)
greetings,
I have a script that is taking input like this:
a
b
c
d
aa
bb
aaa
bbb
ccc
ddd
and formating it to be like this:
a b c d
aa bb
aaa bbb ccc ddd (4 Replies)
I'm pretty sure I already know the answer to this, but I want to make sure I'm not overlooking anything. I'm working on a log monitoring script and every 10 lines I want to display a summary of events. The thing is, there are a lot of possible events, that likely won't have happened, so I only want... (0 Replies)
I have the following bash script and it is not accepting the lines
"--"|"--""-")
"--""-"")
while
do
echo "Current Argument is ${1}"
case "$1" in
"--"|"--""-")
echo "Argument is ${1}"
shift # Skip ahead one to the next argument.
... (1 Reply)
Hello All,
I am writing a script that is to be placed on multiple servers, and of course I've started
running into some compatibility issues for certain shell commands.
The code below worked just fine on most of my machines except for a couple.
Here I had 4 separate lines in my script that... (3 Replies)
Hello All,
I'm in the middle of a script and I'm doing some checks with REGEX (i.e. using the '"shopt -s nocasematch"
that at least the first one should print "FALSE" but it prints "TRUE"..?
For Example:
#!/bin/bash
MY_VAR="HELLO"
### This prints "TRUE"
PATTERN_1="^*"
if ]
then... (5 Replies)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
Hi Gurus,
I have the below BASH code which does not works for upper case alphabets except Z (upper case Z).
What may be the reason. Also escape sequences like \n, \t, \b, \033(1m \033(0m (For bold letter) are not working.
case $var in
)
echo "Lower case alphabet"
;;
... (7 Replies)
I'm having an issue with bash read input when using a case statement.
The script halts and doesn't read the input on the first loop. if I hit enter then the scripts starts to respond as expected. Need some help here.
defaultans=8hrs
read -e -i $defaultans -p "${bldwht}How long would you like... (5 Replies)
Discussion started by: woodson2
5 Replies
LEARN ABOUT OSX
sockatmark
SOCKATMARK(3) BSD Library Functions Manual SOCKATMARK(3)NAME
sockatmark -- determine whether the read pointer is at the OOB mark
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/socket.h>
int
sockatmark(int s);
DESCRIPTION
To find out if the read pointer is currently pointing at the mark in the data stream, the sockatmark() function is provided. If sockatmark()
returns 1, the next read will return data after the mark. Otherwise (assuming out of band data has arrived), the next read will provide data
sent by the client prior to transmission of the out of band signal. The routine used in the remote login process to flush output on receipt
of an interrupt or quit signal is shown below. It reads the normal data up to the mark (to discard it), then reads the out-of-band byte.
#include <sys/socket.h>
...
oob()
{
int out = FWRITE, mark;
char waste[BUFSIZ];
/* flush local terminal output */
ioctl(1, TIOCFLUSH, (char *)&out);
for (;;) {
if ((mark = sockatmark(rem)) < 0) {
perror("sockatmark");
break;
}
if (mark)
break;
(void) read(rem, waste, sizeof (waste));
}
if (recv(rem, &mark, 1, MSG_OOB) < 0) {
perror("recv");
...
}
...
}
RETURN VALUES
Upon successful completion, the sockatmark() function returns the value 1 if the read pointer is pointing at the OOB mark, 0 if it is not.
Otherwise, the value -1 is returned and the global variable errno is set to indicate the error.
ERRORS
The sockatmark() call fails if:
[EBADF] The s argument is not a valid descriptor.
[ENOTTY] The s argument is a descriptor for a file, not a socket.
SEE ALSO recv(2), send(2)HISTORY
The sockatmark() function was introduced by IEEE Std 1003.1-2001 (``POSIX.1''), to standardize the historical SIOCATMARK ioctl(2). The
ENOTTY error instead of the usual ENOTSOCK is to match the historical behavior of SIOCATMARK.
BSD October 13, 2002 BSD