Login or Register to Ask a Question and Join Our Community

Search Results

Search: Posts Made By: binlib
7,172
Posted By binlib
single quote the &&.
single quote the &&.
3,179
Posted By binlib
(GNU) sort on Linux has a -z option to sort NULL...
(GNU) sort on Linux has a -z option to sort NULL delimited, multi-line records:
sed 's/^2013/\x0&/' log-file |sort -z |tr -d '\0'
13,290
Posted By binlib
From the man page of sftp:
From the man page of sftp:
11,724
Posted By binlib
Nice solutions, although the perl solution can be...
Nice solutions, although the perl solution can be shortened:

perl -le'$_=shift;s/\b(.)/\u$1/g;print' 'are utilities ready for hurricane sandy'
or
perl -ple's/\b./\u$&/g' <<<'are utilities ready...
1,477
Posted By binlib
Interesting problem. One ugly hack: ...
Interesting problem. One ugly hack:
Q="$(clear)1) Quit"
select c in "$Q" ...
do
case $c in
"$Q") break ;;
...
esac
done
862
Posted By binlib
nl does have the ability to only number lines...
nl does have the ability to only number lines matching (basic) regex. But it still leaves extra spaces which may not be acceptable to you. Notice the alignment of the second and last line.
nl -s' '...
11,724
Posted By binlib
bash$ set -- are utilities ready for hurricane...
bash$ set -- are utilities ready for hurricane sandy
bash$ echo "${@^}"
Are Utilities Ready For Hurricane Sandy
5,501
Posted By binlib
ftp> ls -lrt |"tail -1"
ftp> ls -lrt |"tail -1"
2,301
Posted By binlib
I bet you have an extra space in your variable...
I bet you have an extra space in your variable assignment:
SERVER_STATUS= ...
4,253
Posted By binlib
If you just want a quick and dirty estimation: ...
If you just want a quick and dirty estimation:
d=$(diff <(echo "$1" |sed 's/./&\n/g') <(echo "$2" |sed 's/./&\n/g') |grep -c '^[<>]')
echo $((100-100*d/(${#1}+${#2})))%
1,844
Posted By binlib
Change for(i=2;i<=NF;i++) if ($i !=...
Change
for(i=2;i<=NF;i++)
if ($i != "[ACGTN]") { $i = "N" }
if ($i != "N") {
if (!($i in a))
n[++c]=$i
a[$i]++
}
to
for(i=2;i<=NF;i++)
if ($i ~...
1,622
Posted By binlib
grep . *.phe.ps |sed 's/\.phe\.ps:/ /'
grep . *.phe.ps |sed 's/\.phe\.ps:/ /'
1,610
Posted By binlib
pr -t -s' ' -2 -l 7 input
pr -t -s' ' -2 -l 7 input
3,179
Posted By binlib
You seemed to have a misunderstanding about how...
You seemed to have a misunderstanding about how pipe works. A pipe has a typical 4k buffer so you can write more than one byte to it. You tried hard to write one byte a time to the pipe (which is not...
Forum: AIX 12-30-2012
36,516
Posted By binlib
Try to find info on the server side by either...
Try to find info on the server side by either trace the sshd server with truss (on aix, strace on linux) "truss -f -p pid-of-sshd" or change LogLevel to DEBUG in the sshd conf file.
880
Posted By binlib
sed '/AA/!d;/BB/!d'
sed '/AA/!d;/BB/!d'
14,544
Posted By binlib
This is how you assign value to variable in bash...
This is how you assign value to variable in bash and most other shells:
var=val
not
set var = val
1,110
Posted By binlib
In bash or ksh: cp -a...
In bash or ksh:
cp -a /!(bin|usr|var|tmp|sys|guest_roots)/ /guest_roots
mv /!(bin|usr|var|tmp|sys|guest_roots)/ /guest_roots
Forum: Linux 12-26-2012
3,811
Posted By binlib
if [ logic ] then sleep 34 continue fi
if [ logic ]
then
sleep 34
continue
fi
1,702
Posted By binlib
I will assume you want to change the header but...
I will assume you want to change the header but keep the rest of the 30 million lines. Since the new header has the same length, the following will open file for both reading and writing:
sed -Ee...
1,277
Posted By binlib
The offset in TZ for GNU date (or libc?) seemed...
The offset in TZ for GNU date (or libc?) seemed can't be bigger than 24. You need to convert the day part into -d argument as you said. Either override your date command with a function:
function...
1,443
Posted By binlib
script is the right approach, but if you don't...
script is the right approach, but if you don't want to use it, then run bash in interactive mode with option "-i" and read all the commands through stdin.
echo 'cd /root/;ls |grep .sh
lspci |grep...
3,077
Posted By binlib
You should use batch mode "sftp -b - $HOST...
You should use batch mode "sftp -b - $HOST <<RESULT" and check exit code $? of sftp in scripting.
2,837
Posted By binlib
So this is a CSV file (except that it's using the...
So this is a CSV file (except that it's using the pipe character as delimiters instead of commas). Whatever is used to process this file should have the ability to parse it. Therefore you should do...
9,717
Posted By binlib
Your command line worked on my Linux, with find...
Your command line worked on my Linux, with find version 4.4.2.
Showing results 1 to 25 of 377

 

Featured Tech Videos