Search Results

Search: Posts Made By: nms
7,117
Posted By nms
Thank you all for your inputs! Looking at...
Thank you all for your inputs!

Looking at little bit at Perl one-liner did the trick

perl -pe 's{(\([^\)]*\))}{($r=$1)=~s/ //g;$r}ge' test.txt
7,117
Posted By nms
Hi, Thanks for your responses....
Hi,

Thanks for your responses. Unfortunately, none of these worked. Forgot also to tell that the platform is Solaris 10 i86.

[PRODUCTION] root@das:/var/opt/Aspider-NGI/nms/output> awk -F'[)(]'...
7,117
Posted By nms
Removing spaces between parenthesis ()
Hello,

i 've go a file with the following text:

oracle@das (J005) 0
oracle@das (J008) 0
oracle@das...
1,073
Posted By nms
Appending content of a file to another file before a specific character
Hi there,

i've got a file with this content

[matt@matt01 tmp]$ cat file1
Matt
Mar


The other file has the same number of lines with this content:
[matt@matt01 tmp]$ cat file2...
905
Posted By nms
Add previous text when replacing comma with new line
Hi,

I've got this output:

[matt@gateway output]# cat test2.txt
TM1ITP1-TMNLSTP1 SLC00=0,SLC01=0,SLC02=0,SLC03=0


if I just use cat test2.txt | tr "," "\n" I'll end up very near to what I'm...
2,276
Posted By nms
Hi Don, you are correct. in fact, I'm using...
Hi Don, you are correct.

in fact, I'm using the $0 now and it's working.

Thanks for the info.
2,276
Posted By nms
Remove new line starting with a numeric value and append it to the previous line
Hi,

i have a file with multiple entries. After some tests with sed i managed to get the file output as follows:

lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1,...
3,756
Posted By nms
Excellent, that really simplifies the job. I have...
Excellent, that really simplifies the job. I have used the one-liner for my benefit as follows:

#!/bin/bash

PROCLIST=$1
tmp=`ps ax -ocomm= | grep -E "${PROCLIST//+/|}" | sort | comm -13 -...
3,756
Posted By nms
Hi RudiC, In this case, the test was just...
Hi RudiC,

In this case, the test was just used as an example. However, if we still take it for our case then nothing exists as a false positive:

[root@matt Linux]# ps ax | grep test | grep -v...
3,756
Posted By nms
Ps ax with grep in loop
Hello,

I have built the following script to check if processes supplied by the argument are running or not.

#!/bin/bash

PROCLIST=$1

PROCESS="0"
ERROR_PROCS=""
IFS='+'
read -ra ADDR...
2,814
Posted By nms
A pipe seperates the column ...
A pipe seperates the column
q_1_2|Orange|news|0|0|0|0|43200|43200

The below is an example:

msg_type=`cat $CRONOUTFILE| grep $AFFILIATE | grep "$MSG_TYPE" | awk -F'|' '{print$3}' `
2,814
Posted By nms
Grep a particular string from column eliminating characters at the end.
Hi,

So basically I have this file containing query output in seperated columns.

In particular column I have the below strings:
news
news-prio

I am trying to grep the string news without...
975
Posted By nms
Hi, Thanks for that hint. i have tried to...
Hi,

Thanks for that hint. i have tried to push the following variables into the -v, so command looks like this:

HOMEDIR=/matt/scripts

awk -v MDIR="$HOMEDIR/text.$1.reference" 'BEGIN { while...
975
Posted By nms
Usage of a variable in awk BEGIN
Hi,


diffcount=`awk 'BEGIN { while ( getline < "/scripts/matt/text.server1.reference" ) { arr[$0]++ } } { if (!( $0 in arr ) ) { print } }' $TMPDIR/$(basename $0 .sh) | wc -l`
if [[...
1,973
Posted By nms
Thanks, both nawk and /usr/xpg4/bin/awk worked
Thanks, both nawk and /usr/xpg4/bin/awk worked
1,973
Posted By nms
Hi, Thanks. i understood the flow but can't...
Hi,

Thanks. i understood the flow but can't understand where the error is:

awk: syntax error near line 1
awk: illegal statement near line 1

i added a "}" in

echo "Critical - the...
1,973
Posted By nms
For loop or while loop from a text file
Hi all,

i developed a script to measure the uptime of a process in a Solaris 10/11 environments.
All is well, but i came across a situation where there are multiple processes of the same name....
13,036
Posted By nms
Hi, Thanks everybody for the replies. The...
Hi,

Thanks everybody for the replies. The "-5days" part is what i was missing!

Yes Andrew, you don't need to munge it at all.

Rgds
13,036
Posted By nms
Get a given date and subtract it to 5 days ago
Hi all,

I have been researching to obtain SSL certification expiry for most of our webistes. For some cases, some hosts where not directly accessible so i finally got a solution working with curl...
8,988
Posted By nms
Multi Dimensional array in bash
Hi, I'm developing a script which contains a multi dimensional array, however for some reason the array is not iterating.

When executing the script, services are listed as arguments from argument...
6,538
Posted By nms
Multi Dimensional array
I have an array of names. Each one of the name, has a number represented to it.

For example A has an ID 8, B has an ID 2.

What I am after is a for loop that when the array is in position 1, a...
1,794
Posted By nms
Thank you for your replies. I will have a go at...
Thank you for your replies. I will have a go at your codes code and let you know!
1,794
Posted By nms
Extract numbers from output file and compare to value
Hi,

I developed a script which finally originates a similar output:

net0:up,Tx=475198bps,Rx=31009bps net1:up,Tx=39596bps,Rx=35678bps

Of course the figures change and also the amount of...
2,834
Posted By nms
Expr: non-numeric argument syntax error on line 1, teletype
Hi,

I tried to look up the issue i'm experiencing, but i'm confused what's wrong with my script.

After executing the script I'm getting the following error

expr: non-numeric argument...
4,497
Posted By nms
Grep lines between last hour timestamp and current timestamp
So basically I have a log file and each line in this log file starts with a timestamp:

MON DD HH:MM:SS
SEP 15 07:30:01

I need to grep all the lines between last hour timestamp and current...
Showing results 1 to 25 of 64

 
All times are GMT -4. The time now is 12:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy