Search Results

Search: Posts Made By: binlib
5,411
Posted By binlib
single quote the &&.
single quote the &&.
1,347
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'
11,449
Posted By binlib
From the man page of sftp:
From the man page of sftp:
2,633
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,142
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
639
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' '...
2,633
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
3,568
Posted By binlib
ftp> ls -lrt |"tail -1"
ftp> ls -lrt |"tail -1"
1,758
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= ...
3,311
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,318
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,295
Posted By binlib
grep . *.phe.ps |sed 's/\.phe\.ps:/ /'
grep . *.phe.ps |sed 's/\.phe\.ps:/ /'
1,232
Posted By binlib
pr -t -s' ' -2 -l 7 input
pr -t -s' ' -2 -l 7 input
2,534
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
28,002
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.
628
Posted By binlib
sed '/AA/!d;/BB/!d'
sed '/AA/!d;/BB/!d'
11,389
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
922
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
2,200
Posted By binlib
if [ logic ] then sleep 34 continue fi
if [ logic ]
then
sleep 34
continue
fi
1,203
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...
890
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,136
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...
2,725
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,210
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...
8,596
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

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