Search Results

Search: Posts Made By: ejdv
1,280
Posted By ejdv
Thanks a lot for your time! Works perfectly.
Thanks a lot for your time!
Works perfectly.
1,280
Posted By ejdv
Thanks a lot. Works like a charm. So the...
Thanks a lot.
Works like a charm.
So the lesson is to substitute the colons that are in the way and later on to substitue them back again.

---------- Post updated at 10:30 AM ---------- Previous...
1,280
Posted By ejdv
[Perl] split on : but with extra challenge
Hi,

I am looking for a little bit more advanced split.

Code:

#!/usr/bin/perl -w #-d
use strict;

my $Line = "value1:{value2a:value2b}:value3:{}:value5:{value6a:value6b}";

my...
1,038
Posted By ejdv
Thanks for the quick reply. So, when I...
Thanks for the quick reply.

So, when I understand it correct, you are saying it is better to always require an option value ?

Like this:
'remove=s' => \$OptRemoveLog,

I guess that is...
1,038
Posted By ejdv
[Perl] Command option with optional value.
Hi,

I would like to parse command line arguments.
The problem I am facing is that I cannot get it right when an option has a optional value.

Example:
# ./ej.pl --remove
# ./ej.pl --remove...
Forum: Programming 03-07-2013
2,091
Posted By ejdv
Thanks for taking time to reply and for your...
Thanks for taking time to reply and for your suggestion.

Could you try to replace the data by variables (my $Value1 = "one", etc) and then try again ?

I get this:
...
Forum: Programming 03-04-2013
2,091
Posted By ejdv
[Perl] Different printf formating for different print options
Hi,

Struggling with single quotes, double quotes, etc.
I want to print a header line, followed by lines with actual values, based on a print option.
In real life it is going to be something like...
2,089
Posted By ejdv
Thanks, but I get the same result: # echo...
Thanks, but I get the same result:
# echo $VALUES
one~two~~~
# echo $VALUES | awk 'BEGIN {FS="~"} {print NF}'
5
# echo $VALUES | awk 'BEGIN {FS="~+"} {print NF}'
5

Ah, this works:

# echo...
2,089
Posted By ejdv
[ksh88 and awk] Number of fields with a value.
Hi,

With:
# VALUES="one~two~~~"
# echo $VALUES | awk 'BEGIN {FS="~"} {print NF}'
5
I can determine the number of fields.

How to determine the number of fields with a value ?
In this case...
1,746
Posted By ejdv
[SOLVED] - [ksh] finding last file with keyword in it
Indeed, this was the solution, I was on the wrong track.
That happens when you are expanding the code, or when you adapt the code to little changes.
In my case, first the BEGIN/END sequence was in...
1,746
Posted By ejdv
[ksh] finding last file with keyword in it
Hi,

In short : I have several log files and I need to find the last file with a certain keyword in it.
# ls -1tr logs
log_hostX.Jan01_0100.gz
log_hostX.Jan01_0105.gz
log_hostX.Jan01_0110.gz...
3,247
Posted By ejdv
Thanks for all the replies. But none of them...
Thanks for all the replies.
But none of them work :-(

Perhaps I had to tell that I am using Solaris 10 as OS.
The .profile sets the shell to ksh.
In the scripts I always use "#!/bin/ksh"....
3,247
Posted By ejdv
[ksh] Weekday a week ago
Hi,

Using TZ and date gives an easy way to find out the dates one or more days ago.
Now I am in need of knowing the date one week ago.
So, now is Thursday and I want to know the date on Thursday...
3,413
Posted By ejdv
Perfect ! Thanks. ---------- Post updated...
Perfect !
Thanks.

---------- Post updated at 01:18 PM ---------- Previous update was at 11:54 AM ----------

The 'trick' is to save the fields one wants use in the end clause in the beginning....
3,413
Posted By ejdv
nawk '{last=$NF} END{print last}' infile ...
nawk '{last=$NF} END{print last}' infile

That is indeed working.

What about the other example ?

# cat /tmp/test_file | /bin/nawk '{} END {split($1,result,":");print result[1]}'
...
3,413
Posted By ejdv
[awk] Simple things not working on Solaris 10
Hi,

Don't know if this is Solaris 10 or that the shell on Solaris 10 is working against me.
But this works fine on HP-UX 11i, but not on Solaris 10:

# cat /tmp/test_file
1:een
2:twee
3:drie...
8,682
Posted By ejdv
Thanks, but I fail to see how to use that in...
Thanks, but I fail to see how to use that in printing the desired output. :-(
This is the @all_comp_products:

DB<2> x @all_comp_products
0 ARRAY(0x22904)
0 'Microsoft'
1 ...
8,682
Posted By ejdv
@tyler_durden, Thanks a lot for this great...
@tyler_durden,

Thanks a lot for this great example.
It should enable me to solve my 'problem'.

---------- Post updated at 11:07 AM ---------- Previous update was at 08:52 AM ----------
...
8,682
Posted By ejdv
@Skrynesaver, Thanks for the quick reply. ...
@Skrynesaver,

Thanks for the quick reply.
Point taken about the i modifier.
In the example of course it had to be field1 iso Field1.

With "a hash keyed on fieldname" you mean something like...
8,682
Posted By ejdv
[Perl] Split lines into array - variable line items - variable no of lines.
Hi,

I have the following lines that I would like to see in an array for easy comparisons and printing:

Example 1:

field1,field2,field3,field4,field5...
Forum: Solaris 08-23-2011
1,565
Posted By ejdv
Thanks for the suggestion. In my case it did...
Thanks for the suggestion.
In my case it did not help.

I decided to open the box and found that the SCSI cables weren't correctly connected.
I swapped them and now everything is okay.
It is a...
Forum: Solaris 08-22-2011
1,565
Posted By ejdv
T5220 disk mapping issue
Hi,

More a Sun T5220 problem then a Solaris 10 problem, but perhaps someone had a similar issue.

For starters the output with 1 disk in slot 0 of the server.
It points to PhyNum 5, where I...
1,597
Posted By ejdv
Thanks for the quick reply. # unset $DATEMSK...
Thanks for the quick reply.

# unset $DATEMSK
ksh: /SA/data/tim/data/timdatemsk: is not an identifier

# at -f /tmp/at.file now
at: getdate: There is no line in the template that matches the...
1,597
Posted By ejdv
[ksh] at -f at.file now not working on Solaris.
I am having problems with the at command on Solaris 10.
There is a HP-UX 11i script that executes another script using at, but on Solaris 10 it doesn't work.

HP-UX:

# cat /tmp/at.file
date
...
1,042
Posted By ejdv
mirni, Thanks for this lesson in coding. I...
mirni,

Thanks for this lesson in coding.
I really appreciate it.

You are right it could be much better, but you know how it is, you start with a begin and end time for one set of log entries...
Showing results 1 to 25 of 79

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