Search Results

Search: Posts Made By: derekludwig
3,764
Posted By derekludwig
This is a job for sed :) sed -e...
This is a job for sed :)

sed -e 's/EncryptedPassword="[^"]*"/EncryptedPassword=""/'
Forum: Solaris 08-30-2015
3,617
Posted By derekludwig
One can also use fmadm to get details: fmadm...
One can also use fmadm to get details:
fmadm faulty
3,179
Posted By derekludwig
The error message was generated because . was not...
The error message was generated because . was not specified as a directory to search by the PATH environmental variable (and bash is not in POSIX mode).

If a variable occurs more than once in a...
3,179
Posted By derekludwig
Trying to emulate how the shell parses a file is...
Trying to emulate how the shell parses a file is going to be slower - but I guess you are trying to avoid side-effects if beSecure is true.

What functionality is the -s providing?

Also, a...
7,491
Posted By derekludwig
The date an account's password has changed is...
The date an account's password has changed is stored in /etc/shadow which is readable only by root.
See shadow for more details.
Forum: Programming 08-25-2015
8,205
Posted By derekludwig
#! /usr/bin/perl use strict; use warnings;...
#! /usr/bin/perl

use strict;
use warnings;
use Spreadsheet::WriteExcel;

my $file = shift @ARGV;
my $workbook = Spreadsheet::WriteExcel->new($file) or die "can't create worksheet: $!";

my...
Forum: Red Hat 08-25-2015
5,067
Posted By derekludwig
Adapting DonC's code: sed...
Adapting DonC's code:
sed 's/"172.27'"${oldValue}"'"/"172.27'"${newValue}"'"/g file.xml > file.xml.$$ && cp file.xml.$$ file.xml
rm -f file.xml.$$Note that XML allows for either single or double...
9,082
Posted By derekludwig
To also print out the key that is used to sort: ...
To also print out the key that is used to sort:

where $, is set to the separator of your choice, in this case, a space is used.
2,494
Posted By derekludwig
You could make use of the functionality of...
You could make use of the functionality of mktemp. Something like:
TRASHFILE=$(mktemp --tmpdir=${TRASHDIR} $(basename ${file}).XXXXXX)One thing to keep in mind is that moving files to your "recycle...
5,456
Posted By derekludwig
Perl is one way, but since there is usually more...
Perl is one way, but since there is usually more than one way to do this:
awk '5 <= length && length <= 20'
sed -ne '/^.\{5,20\}$/p'
5,456
Posted By derekludwig
with sed: sed -e 's/^./\U&/'
with sed:
sed -e 's/^./\U&/'
1,306
Posted By derekludwig
With the understanding that this depends on your...
With the understanding that this depends on your shell and O/S...

'^[^\t ]' will match any line that does not being with a space, a "t" or "\".

If you want to match anything that does not being...
4,404
Posted By derekludwig
mohtashims, Is this the same system you had...
mohtashims,
Is this the same system you had problems with November last year (Find command takes too long [too] complete)?
Are there any symbolic links in the hierarchy? These can be found with:...
Forum: Programming 08-21-2015
8,205
Posted By derekludwig
JB, Can you provide an example of what you...
JB,

Can you provide an example of what you mean by "empty cells to be merged to their respective string".

- DL
9,082
Posted By derekludwig
In perlish: perl -ane 'push @X, [ $F[N] -...
In perlish:
perl -ane 'push @X, [ $F[N] - $F[M], $_ ]; END { print map { $_->[1] } sort { $a->[0] <=> $b->[0] } @X; }'
where N and M are the desired fields - remember the first field is $F[0], the...
6,527
Posted By derekludwig
Or for a sed solution: sed -e...
Or for a sed solution:
sed -e 's/\(\("[^_]*\)_to_\([^"]*"\)\)$/\1,\2_\3/' file
zoneobjectrename "AAA_to_BBB","AAA_BBB"Or a shell solution:
while read key word; do echo $key...
1,339
Posted By derekludwig
Or: sed -e 's/^.*range=//' -e 's/&.*//'or even:...
Or:
sed -e 's/^.*range=//' -e 's/&.*//'or even:
sed -ne 's/^.*range=\([^&]*\)&.*$/\1/p'which will skip lines w/o "range=" entries.
1,641
Posted By derekludwig
To answer your question: grep 000000000038775...
To answer your question:
grep 000000000038775 file
If you asking to extract just the "Remedy Incident Modification record", something like:
sed -ne 's/^.*Remedy Incident Modification record: \([^...
Forum: Programming 08-21-2015
8,205
Posted By derekludwig
Something like: #! /usr/bin/perl use...
Something like:
#! /usr/bin/perl

use strict;
use warnings;
use Spreadsheet::WriteExcel;

my $file = shift @ARGV;
my $workbook = Spreadsheet::WriteExcel->new($file) or die "can't create...
Forum: Programming 08-19-2015
8,205
Posted By derekludwig
We also would need to see the use statements as...
We also would need to see the use statements as well as what you used to create the $wrksheet object.
5,899
Posted By derekludwig
Assuming a linux system, bash or ksh, and that...
Assuming a linux system, bash or ksh, and that that t_date already contains the last day of the month:
$ echo $t_date
20150531
$ date +%Y%m%d -d @$(expr 86400 + $(date +%s -d $t_date))...
5,313
Posted By derekludwig
Just to be clear, ... was meant as a placeholder...
Just to be clear, ... was meant as a placeholder for the command you want to run, in this case snmptable -v2c -c public myIP IF-MIB::ifTable, for you wrote:
My intention was to highlight the parsing...
5,313
Posted By derekludwig
As an example, if I want the index of the entries...
As an example, if I want the index of the entries with a status of 'down':
... | awk '$NF == "down" { print $1; }'if you want the whole row:
... | awk '$NF == "down" { print; }'or:
... | grep '...
1,615
Posted By derekludwig
Arun, You've redirected STDIN twice, you'll...
Arun,

You've redirected STDIN twice, you'll need to remove < /dev/null from the command line.

- DL
13,199
Posted By derekludwig
While not using one of the requested tools: ...
While not using one of the requested tools:
perl -00 -ne 'print $& if m{^\N+\s+BEGIN\s+\N+\n.*?Amit.*?\n\N+\s+END\s+\N+\n}ms;'
Showing results 1 to 25 of 178

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