Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: rdrtx1
2,462
Posted By rdrtx1
awk 'ORS=(NR % 3) ? RS : "\n"' RS=- File.txt >...
awk 'ORS=(NR % 3) ? RS : "\n"' RS=- File.txt > outfile.txt
1,575
Posted By rdrtx1
grep name nameserver.txt | cut -d" " -f1,5...
grep name nameserver.txt | cut -d" " -f1,5 --output-delimiter="." | cut -d"." -f1,7 --output-delimiter=" "
1,536
Posted By rdrtx1
same as above but total included: awk 'BEGIN {...
same as above but total included:
awk 'BEGIN { delta = (delta == "" ? 2 : delta) ; max=20 }
{
if ($1 > max) {
maxf++;
maxc+=$2;
} else {
bucketNr = int(($1+delta) / delta)
cnt++...
2,391
Posted By rdrtx1
It prints the line occurrence of column 1 ($1)....
It prints the line occurrence of column 1 ($1). a[$1]++ fails for the first occurrence increment since the array value for that key does not exist. The ! means not true so the expression is evaluated...
2,391
Posted By rdrtx1
try: sort -k9 -n -r file | awk '!a[$1]++' ...
try:

sort -k9 -n -r file | awk '!a[$1]++'

In output shown above, what happened to the max line for chr1_17232_18061?
6,173
Posted By rdrtx1
more simple? ...
more simple?
CONDITIONS="1=CT,4=US_10,60=CT_US_10"

awk -v CONDITIONS="${CONDITIONS}" -F, '
BEGIN { c=split(CONDITIONS, cn, "[=,]"); }
{n=0;
for (i=1; i<=c; i+=2) if ($cn[i]==cn[i+1]) n+=2;
if...
2,472
Posted By rdrtx1
awk '{ line[NR]=$0; pp[NR] = $2 ll[NR] = $1...
awk '{
line[NR]=$0;
pp[NR] = $2
ll[NR] = $1
x[NR] = $4
y[NR] = $5
z[NR] = $6
rc[$1,$2]++
} END {
first = 1
count = 0
for ( i=1 ; i <= NR ; i++ ) {
if (pp[i] == pp[i+1] && ll[i] ==...
6,173
Posted By rdrtx1
an ex.: CONDITIONS="1=CT,2=US_10,3=CT_US_10" ...
an ex.:
CONDITIONS="1=CT,2=US_10,3=CT_US_10"

CON='$1 == "CT" && $4 == "US_10" && $60 == "CT_US_10"'

awk -v CONDITION="${CON}" -F, '
BEGIN {
c=split(CONDITION, cons, " *&& *");
for (i=1;...
794
Posted By rdrtx1
Can you make a small script to verify that it is...
Can you make a small script to verify that it is not working? i. e.:
set -x

PASSWORD="passwordwith@init"

if [[ "$PASSWORD" != "passwordwith@init" ]]; then
echo testing_code
else
echo...
1,718
Posted By rdrtx1
awk -F, 'v[$1,$2] &&...
awk -F, 'v[$1,$2] && ($8-v[$1,$2])>1;{v[$1,$2]=$8;}' file
2,249
Posted By rdrtx1
awk ' (! h++) {print "transcript_id",...
awk '
(! h++) {print "transcript_id", "gene_name", "description", "chromosome", "strand", "transcript_start", "transcript_end", "gene_start", "gene_end";}
$9 ~ /ID=.*Name=/ {n=$9; sub(".*Name=",...
2,249
Posted By rdrtx1
awk ' (! h++) {print "transcript_id",...
awk '
(! h++) {print "transcript_id", "gene_name", "description", "chromosome", "strand", "transcript_start", "transcript_end", "gene_start", "gene_end";}
$9 ~ /ID=.*Name=/...
2,917
Posted By rdrtx1
try: awk -F, ' function interpolate(lat1,...
try:
awk -F, '
function interpolate(lat1, lon1, t1, lat2, lon2, t2, p) {
for (i = 1; i <= (t2 - t1); i++) {
printf "%.2f,%.2f,%.1f\n",
lat1 + (t2 - t1) * (lat2 - lat1) / p,
lon1 + (t2 - t1) *...
2,955
Posted By rdrtx1
try: if [ "$line" != "\n" ] in case $line is an...
try: if [ "$line" != "\n" ] in case $line is an empty string.
936
Posted By rdrtx1
give space. otherwise it will think it's another...
give space. otherwise it will think it's another variable.
1,532
Posted By rdrtx1
Is this a duplicate post? See example on...
Is this a duplicate post?

See example on other post:
sed -i 's/$$EDWS_DATE_INSERT *=.*/$$EDWS_DATE_INSERT='"$(date "+%y%m%d")"'/' abc.txt
1,788
Posted By rdrtx1
See updated post to fix quotes.
See updated post to fix quotes.
1,788
Posted By rdrtx1
sed -i 's/$$EDWS_DATE_INSERT...
sed -i 's/$$EDWS_DATE_INSERT *=.*/$$EDWS_DATE_INSERT='"$(date "+%y%m%d")"'/' abc.txt
2,862
Posted By rdrtx1
so, fuz or fuzzyanimals (or any string in...
so, fuz or fuzzyanimals (or any string in between) will all evaluate "cat dog"? Why not just use fuz?
3,636
Posted By rdrtx1
fo_ip=$(sed -n '/FailoverSystem/,/}/{/^ *address...
fo_ip=$(sed -n '/FailoverSystem/,/}/{/^ *address /{s/ *address *//;{p;q}}}' config.boot)
echo "$fo_ip"
1,467
Posted By rdrtx1
just an idea: instead of having a loop monitoring...
just an idea: instead of having a loop monitoring the jobs while they run, add a wait after the background jobs are submitted then add a loop to look for failed jobs in the log files and resubmit...
3,384
Posted By rdrtx1
ASCII is a subset of UTF-8. But if there is a...
ASCII is a subset of UTF-8. But if there is a need to transliterate, try something like:
iconv -f UTF-8 -t ASCII//TRANSLIT < input_file
1,994
Posted By rdrtx1
[[:digit:]]E[[:digit:]]
[[:digit:]]E[[:digit:]]
1,888
Posted By rdrtx1
perl -pi -e...
perl -pi -e 's/('$PROCNAME'.Merge.exchMon.'$CODE'.'$T_QSTART'.*)'$CURRENT_QSTART'(.*read)/${1}'$NEW_QSTART'${2}/g' $CONFIG
1,882
Posted By rdrtx1
Can you post a sample input file for the second? ...
Can you post a sample input file for the second?

Updated sample runs with updated second script:
cat << NODES > db_status.txt
Name | Status
------------------
DB 1 | UP
DB 2 | UP
DB...
Showing results 1 to 25 of 448

 

Featured Tech Videos

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