Search Results

Search: Posts Made By: binlib
8,343
Posted By binlib
single quote the &&.
single quote the &&.
4,348
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'
14,723
Posted By binlib
From the man page of sftp:
From the man page of sftp:
22,983
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,679
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
1,031
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' '...
22,983
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
6,402
Posted By binlib
ftp> ls -lrt |"tail -1"
ftp> ls -lrt |"tail -1"
2,787
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,575
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})))%
2,158
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,836
Posted By binlib
grep . *.phe.ps |sed 's/\.phe\.ps:/ /'
grep . *.phe.ps |sed 's/\.phe\.ps:/ /'
1,836
Posted By binlib
pr -t -s' ' -2 -l 7 input
pr -t -s' ' -2 -l 7 input
3,843
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
39,434
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.
1,088
Posted By binlib
sed '/AA/!d;/BB/!d'
sed '/AA/!d;/BB/!d'
15,981
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,269
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
5,342
Posted By binlib
if [ logic ] then sleep 34 continue fi
if [ logic ]
then
sleep 34
continue
fi
2,111
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,454
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,688
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,279
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.
3,342
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...
10,325
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

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