Search Results

Search: Posts Made By: yazu
1,751
Posted By yazu
awk -vRS= '{gsub(/\n/, " ")}1'...
awk -vRS= '{gsub(/\n/, " ")}1' INPUTFILE
3,255
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
3,255
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,859
Posted By yazu
A work for sed.
A work for sed.
1,560
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
12,724
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.
5,547
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...
3,375
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,697
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
3,375
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!'
3,375
Posted By yazu
Try it (GNU sed): sed -E...
Try it (GNU sed):
sed -E 's/(^[^:]+):[^=]+=(.*)/\1 \2/'

Your expression is a mess.
1,744
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)
3,868
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).
3,526
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
4,226
Posted By yazu
awk ' { a = a $0 } /\{\}$/ { print a; a =...
awk '
{ a = a $0 }
/\{\}$/ { print a; a = ""; next }' FILE
Forum: Programming 04-16-2012
9,086
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,938
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]'`
2,264
Posted By yazu
cat FILE | paste - - | sed 's/ Name//'
cat FILE | paste - - | sed 's/ Name//'
4,385
Posted By yazu
ARRAY=(*.dmg)
ARRAY=(*.dmg)
1,717
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
6,924
Posted By yazu
Sorry. Add '-a' : find /root/folder/...
Sorry. Add '-a' :

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

"-type d" means "find" command will find only directories (folders).
1,717
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
6,924
Posted By yazu
Try find FOLDER -maxdepth 1 type -d instead...
Try
find FOLDER -maxdepth 1 type -d
instead of
ls -l FOLDER
2,085
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

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