Search Results

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

sed -e 's/EncryptedPassword="[^"]*"/EncryptedPassword=""/'
Forum: Programming 08-26-2015
5,014
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...
2,027
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...
2,027
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...
5,247
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.
1,378
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: \([^...
2,490
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'
1,805
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...
897
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
1,295
Posted By derekludwig
You are not going to get away from some sort of...
You are not going to get away from some sort of loop:
ls -1 | xargs mv -I {} mv {} boxname_{}or
for file in *; do mv $file boxname_$file; donenow if you can save the files for each system in a...
10,291
Posted By derekludwig
/etc/motd is a file UNIX supports the...
/etc/motd is a file

UNIX supports the following types (from stat):
- files
- directories (not folders)
- devices - character or block
- symbolic link (symlink)
- fifo
- socket

Ddepending...
1,800
Posted By derekludwig
The issue with using cpio is that it preserves...
The issue with using cpio is that it preserves the directory hierarchy. You could go with:
find /.../sourcedir -type f -name '*.txt' -exec cp {} /.../targetdirbut that would generate a process for...
Forum: Open Source 06-14-2015
265,072
Posted By derekludwig
When I started, there were a few editors to...
When I started, there were a few editors to choose from: ed for unix, edt for vms, and an ibm 129 for the big iron.

Then came ex and vi.
Emacs is fun, especially for lisp.

I still use vi, but...
5,730
Posted By derekludwig
Just distributing clues. This one was from some...
Just distributing clues. This one was from some recent experience -- had to clean up a mess on many of 'my' systems where a jr. admin was changing permissions of system files and directories to...
8,442
Posted By derekludwig
XBin, Shouldn't the regex be: ...
XBin,
Shouldn't the regex be:
/-[^-]*-[^-]*-/which matches a line with more than two -s?
52,533
Posted By derekludwig
For processes without an attached terminal: ps...
For processes without an attached terminal:
ps -t -
See the ps manpage for more information.
880
Posted By derekludwig
sed -e 's/^[^0-9]*/string/'
sed -e 's/^[^0-9]*/string/'
1,308
Posted By derekludwig
Or even: sed -e 's/ *;.*$//' -e 's/0x[^ ]* //g'...
Or even:
sed -e 's/ *;.*$//' -e 's/0x[^ ]* //g' inputfile | tee outfile | sort | uniq -c---------- Post updated at 05:20 PM ---------- Previous update was at 04:00 PM ----------

Perlish solution,...
1,439
Posted By derekludwig
Don, Zam, $list[0] is the empty string...
Don, Zam,

$list[0] is the empty string because a space was prepended to $line on line 126.

Zam,

Perhaps a little simplification is needed:
while (<fd_in>) {
s{\s*#.*$}{};
($cpu_id,...
1,268
Posted By derekludwig
The issue will be determining what is a valid XML...
The issue will be determining what is a valid XML tag and what is data that appears between "<" and ">". Is it always numeric? Are there negative numbers? Character strings? With or without...
1,268
Posted By derekludwig
With respects to Scrutinizer, if the XML tags are...
With respects to Scrutinizer, if the XML tags are nested on the same line, are empty, have multiples on a line, or span multiple lines, as in:
<?xml version="1.0" encoding="UTF-16"?>
<P1 >
<C1...
6,058
Posted By derekludwig
Gautam Banarjee, Can you check the...
Gautam Banarjee,

Can you check the parameters.txt file that your provided? There are differences between your OnGoto's postings. For example, the parameter accmin has a value of '100' as shown by...
6,058
Posted By derekludwig
Gautam Banerjee, Some of the space separated...
Gautam Banerjee,

Some of the space separated key/value pairs of parameters.txt are malformed:
NCCPERM As Per BSIC PLAN
CS 1 for non MBC
CHAP 6 for MBC
CHAP 11 for BCCH on OLAlso, providing...
6,373
Posted By derekludwig
(The "do something if condition" is a DEC Basic+...
(The "do something if condition" is a DEC Basic+ idiom that perl adopted)

Not to join the language wars - but the moment someone says such-n-such a language is best is naive at best. It really...
894
Posted By derekludwig
LinQ - sed -n -e...
LinQ -

sed -n -e 's/^.*string"\([^"]*\)".*$/\1/p' file will print only the target strings, skipping those lines that don't match.

- DL
Showing results 1 to 25 of 42

 

Featured Tech Videos

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