Search Results

Search: Posts Made By: Mudshark
2,108
Posted By Mudshark
Many thanks all for the responses. ...
Many thanks all for the responses.
RavinderSingh13 - That worked ok although I had to use nawk on Solaris.
greet_sed - that also worked fine.
I also found another similar thread and used this...
2,108
Posted By Mudshark
Insert line based on found string
Hi All
I'm trying to insert a new line at the before each comment line in a file.
Comment lines start with '#-----'
there are other comments with in lines but I don't want a new line there....
1,336
Posted By Mudshark
Grep for process in a ksh script
Hi
I'm trying to catch a particular process (XYZ) running using a ksh script. Like So..

VarPS=`ps -ef |grep XYZ |grep -v grep`

However this seems to find the process of the script itself - not...
3,049
Posted By Mudshark
Many thanks all for your help on this. ...
Many thanks all for your help on this.
Suggestions both worked perfectly on my example data.

appreciate the help.

Thanks Don for the explanations.
3,049
Posted By Mudshark
awk to find number in a field then print the line and the number
Hi

I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field.
The source file is pipe delimited and looks something like...
5,798
Posted By Mudshark
Thanks msabhi . I'm using ksh on Solaris. This...
Thanks msabhi .
I'm using ksh on Solaris. This variation worked.
sed -n -e "/$var/,/from/p" x.txt
5,798
Posted By Mudshark
Passing backslash character to awk variable
Hi All.
I have a file that contains some special characters and I'm trying to use AWK to search for lines between <pattern1> and <pattern2>.
As an example:
I need the lines between the line...
Forum: Solaris 10-30-2012
3,382
Posted By Mudshark
Good advice. Thanks os2mac
Good advice. Thanks os2mac
Forum: Solaris 10-29-2012
3,382
Posted By Mudshark
Hi bipinajith - Many Thanks for replying
Hi bipinajith - Many Thanks for replying
Forum: Solaris 10-28-2012
3,382
Posted By Mudshark
Impact on existing users when changing passwd defaults
Hi

Administering Solaris Systems - Solaris 10 mostly.
If I change the /etc/default/passwd settings - E.G. to increase minimum passwd length, then what happens to existing users with passwords...
32,698
Posted By Mudshark
I'll try that - it can be thousands of lines and...
I'll try that - it can be thousands of lines and in multiple files so I'll have a go in awk
32,698
Posted By Mudshark
Thank You Mr J. Actually - I'd got that far -...
Thank You Mr J.
Actually - I'd got that far - I should have made my question clearer. I can get the right result using script on a single value. My issue is with applying the function to multiple...
32,698
Posted By Mudshark
Convert Seconds to hh:mm:ss
Hi All
I need to convert a number of fields in a record from seconds to hh:mm:ss ( or possibly hhh:mm:ss ). I'm guessing awk is the way to go .
File has multiple records and each record contains...
2,704
Posted By Mudshark
date command
Hi All.
I'm using date -a to 'drift' the time forward / backwards. The question is - how do I know when its finished 'drifting' ? On some systems I have another time reference I can use but not...
3,234
Posted By Mudshark
The manual suggests that date -a 'drifts' the...
The manual suggests that date -a 'drifts' the system clock forwards / backwards. If the clock is 5 minutes fast and I do 'date -a -300 ' this presumably would drift the clock backwards 300 sec until...
3,234
Posted By Mudshark
using date -a
How can I monitor the date -a command - e.g. if I enter 'date -a 10' to drift the clock forward by 10sec, how do I know when its completed ? If I run ps -ef|grep date that doesn't seem to work.
...
4,577
Posted By Mudshark
Your solution is much better Thanks Again...
Your solution is much better

Thanks Again for your help
4,577
Posted By Mudshark
Sorry - typo. I've tried a different approach...
Sorry - typo.
I've tried a different approach since I posted --

BEGIN{
FS=OFS=","
nxt=0
}
{
if (( $2 != nxt ))
{print tmp;print $2 "-";tmp=$2;nxt=int($2+1)}
else
{tmp=$2;nxt=int($2+1)}...
4,577
Posted By Mudshark
awk to print mon and max values of ranges
HI all

I'm trying to write an awk script to print the min and max value in a range(s) contained in another file - the range values are in $2
EG
114,7964,1,y,y,n
114,7965,1,y,y,n...
2,783
Posted By Mudshark
Thanks for your help.
Thanks for your help.
2,783
Posted By Mudshark
Working At Last
I think this works

BEGIN {FS=OFS=" "}
{
tsttxt=substr($4,1,3)
if( tsttxt == "03:" )
{print $0
for (i = 1; i <= 13; i++)
{ getline ;print $0 }
}
}
2,783
Posted By Mudshark
Thanks tmarikle - Its close but not quite - I...
Thanks tmarikle -
Its close but not quite - I now get the line with 03: in the 4th field and then just the 13th line after it.
I tried moving the {} around but to no good effect. I need the...
2,783
Posted By Mudshark
Awk script help
I want to search a file where the 4th field begins with 03: and then print the line and the following 14 lines.
I can find the 4th field using awk but then I just get the same line repeated 14...
1,516
Posted By Mudshark
unexpected 'test' operation
Hi - I'm finding some unexpected operation when testing in a ksh script.
EG
TST=`grep donut file1`
FSZ=`ls -l file1 | awk '{ print $5 }'`
if [ -n $TST ] ; then
if [ $FSZ > 200 ] ;then
...
3,626
Posted By Mudshark
debug
Is there a way to debug what is happening within awk - similar to set -x ??
Showing results 1 to 25 of 30

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