Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: yazu
862
Posted By yazu
awk -vRS= '{gsub(/\n/, " ")}1'...
awk -vRS= '{gsub(/\n/, " ")}1' INPUTFILE
1,835
Posted By yazu
What about AIX, HP, Solaris - they do not have -d...
What about AIX, HP, Solaris - they do not have -d option for date.

No. My version is the right. :p
1,835
Posted By yazu
Easy DATE=20160120; echo $DATE | sed 's/[0-9]/&...
Easy
DATE=20160120; echo $DATE | sed 's/[0-9]/& /g' | tr 0-9 a-k |
awk '{print $5, $6, $7, $8, $3, $4}' | sed 's/ //g' |
sed 's/./&-/2; s/./&-/5' | tr a-k 0-9
1,287
Posted By yazu
A work for sed.
A work for sed.
743
Posted By yazu
Maybe something like this? for x in a b c;...
Maybe something like this?

for x in a b c; do echo somestring > $x ;done # for testing

[ `grep -l somestring a b c | wc -l` -eq `ls a b c | wc -l` ] && echo 'All'
All
4,116
Posted By yazu
If you can use lynx then lynx -dump URL ...
If you can use lynx then
lynx -dump URL
produces a good text output of a page. Every link on the page goes to References section in the end of the output.
2,750
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,646
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.)
971
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,646
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!'
1,646
Posted By yazu
Try it (GNU sed): sed -E...
Try it (GNU sed):
sed -E 's/(^[^:]+):[^=]+=(.*)/\1 \2/'

Your expression is a mess.
961
Posted By yazu
And why don't use cat -n (or less -N, or nl) :) ...
And why don't use cat -n (or less -N, or nl) :)

head -n5 file; (tail -n+6 file | cat -n)
2,904
Posted By yazu
Why not grep -B2 5555 | head -1 (-B, not -A) ...
Why not
grep -B2 5555 | head -1
(-B, not -A)

---

And yes, this is a GNU grep extension (thanks, Corona688).
2,662
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
2,959
Posted By yazu
awk ' { a = a $0 } /\{\}$/ { print a; a =...
awk '
{ a = a $0 }
/\{\}$/ { print a; a = ""; next }' FILE
Forum: Programming 04-16-2012
6,178
Posted By yazu
cat FILE I have a pen and notebook. I...
cat FILE
I have a
pen and
notebook.

I have a
pen and
notebook.
~
perl -00 -pe 's/\n/ /g; s/ $/\n/' FILE
I have a...
1,584
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,412
Posted By yazu
cat FILE | paste - - | sed 's/ Name//'
cat FILE | paste - - | sed 's/ Name//'
2,609
Posted By yazu
ARRAY=(*.dmg)
ARRAY=(*.dmg)
1,243
Posted By yazu
perl -0777 -ne 's/\s+/ /g; print "$_\n" for...
perl -0777 -ne 's/\s+/ /g;
print "$_\n" for /\d+\*\*\*.*?(?=\d+\*\*\*|$)/msg' FILE
4,568
Posted By yazu
Sorry. Add '-a' : find /root/folder/...
Sorry. Add '-a' :

find /root/folder/ -maxdepth 1 -a type -d
4,568
Posted By yazu
your folder :) "-type d" means "find"...
your folder :)

"-type d" means "find" command will find only directories (folders).
1,243
Posted By yazu
Try: perl -0777 -ne 's/\s+/ /g; print "$_\n"...
Try:
perl -0777 -ne 's/\s+/ /g;
print "$_\n" for /\d\*\*\*.*?(?=\d\*\*\*|$)/msg' FILE
4,568
Posted By yazu
Try find FOLDER -maxdepth 1 type -d instead...
Try
find FOLDER -maxdepth 1 type -d
instead of
ls -l FOLDER
1,288
Posted By yazu
Oh... Well, I didn't notice. But I think it's...
Oh... Well, I didn't notice. But I think it's impossible without additional information - how should the program determine what field is absent? Is the second field always present and it is TIPxxx?
Showing results 1 to 25 of 500

 

Featured Tech Videos

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