Search Results

Search: Posts Made By: Skrynesaver
291
Posted By Skrynesaver
Which shell are you using? I'm relying on a...
Which shell are you using?

I'm relying on a Bash convention here that anything inside $(( ...)) gets mathematically evaluated in the condidtion.
291
Posted By Skrynesaver
Hi Sadique, I left out a closing...
Hi Sadique,

I left out a closing parenthesis, I've also added full path to the stat command:

if [ $(( $(date +%s ) - $(stat -t ${PATH_TO_EXISTING_DIRECTORY}/$(ls -lrt...
291
Posted By Skrynesaver
So every 10 minutes, check the directory and if...
So every 10 minutes, check the directory and if the most recent file is greater than 10 minutes old send a mail with the subject "No new files seen since ${LATEST_FILE_TIMESTAMP}"

You can use cron...
1,329
Posted By Skrynesaver
you don't specify the scripting language, so I'm...
you don't specify the scripting language, so I'm going to assume you're using bash...

fileName="Device_manumodel_$( date +%Y%m%d%H%M).csv"
12,216
Posted By Skrynesaver
It is possible, there is a Power Shell build for...
It is possible, there is a Power Shell build for Linux available (on GitHubl (https://github.com/PowerShell/PowerShell))

However systemctl status postgresql is the preferred method to test the...
394
Posted By Skrynesaver
$ cat tmp.dat NEED="TEST=Name WORK=Ps DEL=let" ...
$ cat tmp.dat
NEED="TEST=Name WORK=Ps DEL=let"

$ perl -ne '@assignments=$_=~/(\w+=\w+)/g;}{print join("\n",@assignments);' tmp.dat
TEST=Name
WORK=Ps
DEL=let
$
575
Posted By Skrynesaver
That's a shell command ;) I can break it into...
That's a shell command ;) I can break it into digestible chunks if you wish

perl -ne ' #Call the Perl interpreter and iterate over every line in the files listed as arguments with...
575
Posted By Skrynesaver
[skrynesaver@busybox]$cat tmp.dat name,id,flag ...
[skrynesaver@busybox]$cat tmp.dat
name,id,flag
apple,1,Y
apple,2,N
mango,1,Y
mango,2,Y
[skrynesaver@busybox]$ perl -ne 'chomp;@r=split/,/; push @{$fields{$r[0]}},$r[1] if $r[2] eq "Y";}{for...
Forum: AIX 08-16-2017
1,600
Posted By Skrynesaver
visudo and add the user or, if you have an...
visudo and add the user or, if you have an administrative group (eg. wheel) add the user to the group with adduser $USERNAME wheel
493
Posted By Skrynesaver
How would you call Nessus on the command line to...
How would you call Nessus on the command line to scan a single IP and generate a report?
1,221
Posted By Skrynesaver
Hi Sunil, which OS and which release are you...
Hi Sunil,

which OS and which release are you using?

Could you paste the contents of the following files?

~/.vimrc
/usr/share/vim/vimrc
/etc/vimrc
928
Posted By Skrynesaver
perl -npi -e "s/^(\S+) (.+)/'\1' a2/"...
perl -npi -e "s/^(\S+) (.+)/'\1' a2/" tmp.dat
Forum: HP-UX 03-08-2017
1,524
Posted By Skrynesaver
(11.23) 11i v2 was released in 2003, and was...
(11.23) 11i v2 was released in 2003, and was EOL'd in December 2015

11i v3 will be supported up to 2020.
553
Posted By Skrynesaver
hn.rstrip("\n\r") in order to lose the new line...
hn.rstrip("\n\r") in order to lose the new line character
1,958
Posted By Skrynesaver
$ cat test.file 123andsomeothervalues with a...
$ cat test.file
123andsomeothervalues with a space at position 22
Not 123 but with the space
123 but no spacein the appropriate column

$ perl -npi.bak -e 's/^(123.{18}) /$1X/' test.file

$...
1,958
Posted By Skrynesaver
perl -npi.bak -e ' s/(123.{797}) /${1}X/' infile
perl -npi.bak -e ' s/(123.{797}) /${1}X/' infile
1,390
Posted By Skrynesaver
Has the target host changed recently (eg. been...
Has the target host changed recently (eg. been re-imaged, reinstalled or assigned a new IP)?
If so opening the .ssh/known_hosts file and removing the record for the previous host at that IP is safe,...
666
Posted By Skrynesaver
examine the /etc/profile file and see line 233,...
examine the /etc/profile file and see line 233, it seems that someone has written a bash_profile over /etc/profile (shopt is a bash shell builtin)
Forum: Red Hat 08-31-2016
1,833
Posted By Skrynesaver
There's a field in /etc/shadow which sets how...
There's a field in /etc/shadow which sets how many days before expiry the user is warned, however this warning is on logon and so will not work for rarely administered boxes.
chage -l root will give...
857
Posted By Skrynesaver
ssh user@host quota Or if querying other...
ssh user@host quota

Or if querying other users quotas (assuming you have the rights)
ssh me@host quota user
588
Posted By Skrynesaver
\1 holds the value of the first capture group on...
\1 holds the value of the first capture group on the lhs of a substitution

google sed capture groups for many detailed discussions
1,387
Posted By Skrynesaver
Similar logic in awk $ awk -F\ ' ...
Similar logic in awk

$ awk -F\ '
{count[$1]++;
if ((count[$1]==2) && ($3~/\(/)){
record[$1]=gensub(/([^ ]+ +[^ ]+ +[^ ]+ +[^ ]+)(.+)/,"\\1new\\2",1,record[$1]);
}...
1,387
Posted By Skrynesaver
Assumes file can fit in memory... A less memory...
Assumes file can fit in memory...
A less memory intensive cersion is alos possible reading the file in blocks of 3 lines


$ cat tmp/tmp.pl
#!/usr/bin/perl
use strict;
use warnings;
open (my...
9,379
Posted By Skrynesaver
I discovered the joys of adding the DOMAIN=......
I discovered the joys of adding the DOMAIN=... pragma to /etc/sysconfig/network-scripts/ifcfg-${INTERFACE_ID}

Thanks all
9,379
Posted By Skrynesaver
Centos 7 Network Manager overwriting resolv.conf
Hi all,

I need to add domain and search parameters to resolv.conf, however network manager overwrites.

Setting the PEERDNS=No in the interface file seems to have no effect on this behaviour.
...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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