This is how the DHCP messages look like in the logs
Nov 4 06:47:22 dhcp01 ZEMdhcp: 01/0010E7218F82: Got DHCPDISCOVER xid=0x2158b2c1 from 0.0.0.0 via 10.140.2.10, req-ip=None, 82=None.
I have some MAC addresses that I need to monitor - how many discovers they send per day. The MAC addresses look like this : 0010E7218F82.
The output of the following script is :
That's the count of the DHCP discovers sent by this MAC.
I have a list of MACs that I need to monitor, that's why I need to put 0 for the MACs that do not issue any discover. Then copy-paste the results into an excel.
So how can i adapt the script above to have the output like :
0 0010E7218F82
if it does not find anything ?
Liviu
---------- Post updated at 11:00 AM ---------- Previous update was at 10:54 AM ----------
Quote:
Originally Posted by Chubler_XL
How about using awk
This works! Thanks a lot!
---------- Post updated at 11:28 AM ---------- Previous update was at 11:00 AM ----------
Thanks Chuber,
How can I set this code for a pattern ?
Lets say that I have a list of MACs like this
0012CFCDA11A
0012CFCDA123
0012CFCD7123
..and I want to apply the code for each MAC addreses in the list ?
Hi,
I have a comma delimited string, e.g. empno, ename, sal.
Using Korn Shell Script I want to build the SET clause for an UPDATE statement, and set clause should look like this:
empno=decode(:empno, '?', empno, :empno),
ename=decode(:ename, '?', empno, :ename),
sal=decode(:sal, '?',... (14 Replies)
hi,
pls could you help me with one program in KSH ( i have sunOS).
I need to create an If clause, that prints an error message and filenames, when in a directory are found some files of null size (find . -type f -size 0 ).
thanks (3 Replies)
Hello,
I want to checkl whether my file has text in it or not.
if ; then
...
if ; then
...
But none of these work
Can someone help me?
---------- Post updated at 09:00 AM ---------- Previous update was at 08:55 AM ----------
The code-tags caused an displayerror,... (5 Replies)
Hi guys,
I am trying to check the values i have for two variables.
if && ; then
echo "Success";
fi
Now Test1 can have any Alpha Variable and Count is a integer value.
Even though we have given 'and' Condition, even one condition is sucess, i am getting the Success message.
... (11 Replies)
HI friends ,
I am very new to perl .please dont mind if i ask silly questions.
I seee below code in one sript
if ( exists $ENV{FMTWRP_TMP_DIR} and $ENV{FMTWRP_TMP_DIR} ) {
$tdir = $ENV{FMTWRP_TMP_DIR};
}
whats does this mean .
I am very confused about the if clauses in... (1 Reply)
Hi
can anyone please explain what the below code does?
i mean $fide_stopfile = ?
when $FIDE_SCR = '/fs/dir1/dir2/common/scr'
and also little confused with if clause too.
what it check?
$fide_stopfile = "$ENV{FIDE_SCR}/../tmp/STOP";
if ( -e $fide_stopfile > 0 ) {
... (3 Replies)
Hi All,
I need to write one shell script. The requirement is as follows.
a) I am having list the employee names in a file stored in /tmp directory location as below
/tmp/emp.txt
b) and the contents are as below
cat emp.txt
ravi
raj
ram
arun
c) I need to connect to sybase... (1 Reply)
Hi everyone,
Simple question.
I have a comma-delimited file, aux.txt, with the following contents (all in one line):
'value1','value2','value3',...,'valueN'
I would like to know if there's a way I can use that file inside a sql script in a where clause, like so:
select myfield1 from mytable... (6 Replies)
Hi,
i need to add a condition in my IF clause where i need to check if the file exists in a folder and return true out of it. but in my directory i have multiple files with same name but datestamp append on it for e.g.
export f1 = filename
export f2=filename1
if ]
then
echo "No... (9 Replies)
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)