Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: yazu
3,121
Posted By yazu
With GNU utils everything is simpler but well......
With GNU utils everything is simpler but well... AIX 6

echo '20170001
20319900
20110232
20000001
20160230
20160229' | while read d; do
date -d$d '+%Y%m%d'; done
date: invalid date...
1,810
Posted By yazu
I learnt sed here...
I learnt sed here (http://www.catonmat.net/blog/sed-one-liners-explained-part-one/) (but I read something before - this (http://www.grymoire.com/Unix/Sed.html) is good.)
1,034
Posted By yazu
Yes it's a good one. perl -e ' require...
Yes it's a good one.
perl -e '
require Net::IP;
$str = "2620:0:2d0:200:0:0:0:7";
$ip = new Net::IP($str, 6);
print $ip->print, "\n";
'
2620:0:2d0:200::7/128
1,810
Posted By yazu
GNU sed with "-E" (or -r - they are the same)...
GNU sed with "-E" (or -r - they are the same) option

For solaris this should work

sed 's!^\([^:]*\):[^=]*=\(.*\)!\1 \2!'
2,736
Posted By yazu
Try: 1. Use ordinary quotes instead of double...
Try:
1. Use ordinary quotes instead of double ones.
2. Insert a literal newline after "i" command.

sed -e 'i\
H,0001' -e 's/$/,1,2/' abc > abc.tmp
1,629
Posted By yazu
var=`perl -MList::Util=shuffle -le '@s = shuffle...
var=`perl -MList::Util=shuffle -le '@s = shuffle (a..z, 0..9); print @s[0..7]'`
1,493
Posted By yazu
cat FILE | paste - - | sed 's/ Name//'
cat FILE | paste - - | sed 's/ Name//'
4,928
Posted By yazu
Try find FOLDER -maxdepth 1 type -d instead...
Try
find FOLDER -maxdepth 1 type -d
instead of
ls -l FOLDER
Forum: Programming 04-10-2012
1,823
Posted By yazu
You don't need '-n' option here.
You don't need '-n' option here.
Forum: Programming 04-10-2012
1,818
Posted By yazu
print substr($testline, 0, 50), "\n"
print substr($testline, 0, 50), "\n"
1,190
Posted By yazu
??? find . -type d
???
find . -type d
2,428
Posted By yazu
cat FILE ...
cat FILE
https://ims-svnus.com/dev/DB/trunk/feeds/templates/shell_script.txt -r860
https://ims-svnus.com/dev/DB/trunk/feeds/perl/templates/perl_script.txt -r867...
8,611
Posted By yazu
You can try (in ksh93): typeset -lE
You can try (in ksh93):
typeset -lE
4,676
Posted By yazu
Try: ls | egrep 'log_[0-9]+\.xml'
Try:
ls | egrep 'log_[0-9]+\.xml'
Forum: Red Hat 10-28-2011
2,198
Posted By yazu
man sudoers
man sudoers
1,901
Posted By yazu
Try: cp -ar DIR DIR-BAK cd DIR for f in...
Try:
cp -ar DIR DIR-BAK
cd DIR
for f in *.dat; do
awk 'NF == 1 { $2 = 0 }1' "$f" > ~temp
mv ~temp "$f"
done
2,903
Posted By yazu
Here is my code but it doesn't work. It's because...
Here is my code but it doesn't work. It's because of line ends. Somewhere you have dots, somewhere commas and in one line - 704/11 762,.

perl -F',\s+' -lane ' ...
1,473
Posted By yazu
sed 's/^[A-Z][A-Z]*://' or GNU sed with ERE...
sed 's/^[A-Z][A-Z]*://'
or GNU sed with ERE (extended regular expressions):
sed -r 's/^[A-Z]+://'
1,294
Posted By yazu
Remove spaces: '"${datein}"'
Remove spaces:
'"${datein}"'
984
Posted By yazu
(echo aaa.txt grep xxx aaa.txt | awk '{print $4...
(echo aaa.txt
grep xxx aaa.txt | awk '{print $4 }' |
while read n; do #
[ "$n" -ne $((prev+1)) ] && echo #
printf "$n," ...
984
Posted By yazu
I like pipes (and cats I like too :) ): cat...
I like pipes (and cats I like too :) ):
cat INPUTFILE |
while read n; do #
[ "$n" -ne $((prev+1)) ] && echo ...
983
Posted By yazu
sed ' 1 ...
sed '
1 s/^/DATA_ACQ_CYC_CNTL_ID|DATA_ACQ_CYC_CNTL_SNPSHT_DT|/
2,$ s/^/1783579|090511|/
' INPUTFILE
1,303
Posted By yazu
Oops. I made an awful typo - not NR, but NF....
Oops. I made an awful typo - not NR, but NF. Well, I'm seeing about OFMT.

===

Yes, OFMT is useless (it's just for "print FLOAT"). You can do this:
awk -v min=0.001 -v max=1000.0 '
{
for...
1,303
Posted By yazu
awk -v min=0.001 -v max=1000.0 '{ $1 = $1 #...
awk -v min=0.001 -v max=1000.0 '{
$1 = $1 # the same formating for all lines
for (i=1; i<=NR; i++)
if ($i)
if ($i < min) $i = min
else if ($i > max)...
3,204
Posted By yazu
find . -mtime +30 -name 'Tkttrans*.tmp' -print |...
find . -mtime +30 -name 'Tkttrans*.tmp' -print | xargs rm
Showing results 1 to 25 of 230

 

Featured Tech Videos

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