Search Results

Search: Posts Made By: RudiC
859
Posted By MadeInGermany
Attention: ssh -qn is ssh -q -n where -n...
Attention:
ssh -qn is ssh -q -n where -n inhibits reading from stdin - good for ssh -q -n remotehost remotecommand. But it must be ssh -q remotehost < file and ssh -q remotehost << heredoc and ...
435
Posted By rbatte1
If you have them in a file, how about:-cut -f-3...
If you have them in a file, how about:-cut -f-3 -d"." input|sort|uniq -cWould that do? It's not quite the pretty output, but you get the detail you need.



I hope that this helps,
Robin
Forum: Shell Programming and Scripting 4 Weeks Ago
926
Posted By Scrutinizer
Indeed \| is a GNU extension to Basic Regular...
Indeed \| is a GNU extension to Basic Regular Expressions ( BRE ), as are \? and \+. But I do not see a use for them, since GNU utilities also support at least Extended Regular Expressions (ERE)...
897
Posted By MadeInGermany
${IARR[-1]} is bash-4. ksh (and bash-3) need...
${IARR[-1]} is bash-4.
ksh (and bash-3) need ${IARR[${#IARR[@]}-1]}

read -A and <<< require ksh93 - do not work with the older ksh88.
1,039
Posted By gull04
Hi, Using the data that you provided in the...
Hi,

Using the data that you provided in the previous post and the "grep" already supplied I get;

[e434069@fbakirpomd4 data]$ grep -v " [01] *[+-]" test_01.txt
chr10 85504 85558...
380
Posted By gull04
Hi, If by; You actually mean to output...
Hi,

If by;

You actually mean to output the first file to the printer and then to reposition the paper to the first line and print the second file on a line by line basis starting at the first...
1,355
Posted By MadeInGermany
The if (t ~ $1) is a RE match that is "fuzzy"...
The if (t ~ $1) is a RE match that is "fuzzy" unless it is anchored.
Should be if (t ~ ("^" $1)); the ^ anchor means the string $1 must occur at the beginning of string t.
1,685
Posted By jim mcnamara
Do you need distinct awk functions for every line...
Do you need distinct awk functions for every line of text or just a few functions? Sample input, output would help a lot.

Edit: I don't understand the request either....
146
Posted By rdrtx1
here: 🥄
here: 🥄
315
Posted By wisecracker
Hi amar1208... Just a note reference...
Hi amar1208...

Just a note reference rdrtx1's post #2:
The first line should read something like #!/bin/bash as 'sh' assumes POSIX compatibility so ARRAYS are technically not possible.
Make...
4,756
Posted By Chubler_XL
You could try using index and substr instead of...
You could try using index and substr instead of match to avoid regex overheads. This takes about 2mins for a 2GB file on my system:

awk '
BEGIN {
HDLN =...
4,756
Posted By Scrutinizer
I did some testing and RudiC's second method...
I did some testing and RudiC's second method turned out to be fastest.

I would suggest trying mawk

In tests I conducted with RudiC's approach mawk was several orders faster than regular awk...
1,375
Posted By joeyg
When you address RudiC, and your approach to...
When you address RudiC, and your approach to this, you should also include a reason for the request.
Your request does not seem to have any logical reason, and thus gives the impression that it is...
1,660
Posted By Don Cragun
Note that RudiC's and Scrutinizer's suggestions...
Note that RudiC's and Scrutinizer's suggestions both depend on the fact that the orgX and orgXX strings in file2 are distinct. Had file2 also contained the line:
org2=japan
both of those...
1,778
Posted By sandeepgoli53
Hi Guys, I am able to get desired output...
Hi Guys,

I am able to get desired output after changing my shell script as mentioned below.

#!/bin/bash
file="db_detail.txt"
. $file
rm /batch/corpplan/bin/dan.csv...
1,756
Posted By vgersh99
Just to quote RudiC: A desired output would...
Just to quote RudiC:

A desired output would be helpful as well....
Also, you've been asked to start using code tags when posting code/data sample...
1,428
Posted By wisecracker
This is the third time you have asked this and...
This is the third time you have asked this and you have been steered in the right direction - twice:
...
4,345
Posted By nezabudka
Maybe this will help? arr=(${arr[@]: -2}...
Maybe this will help?
arr=(${arr[@]: -2} ${arr[@]:0:$((${#arr[@]}-2))})
echo ${arr[@]}
4,345
Posted By MadeInGermany
Comment on the previous solution: it allows echo...
Comment on the previous solution: it allows echo ${array[-i]} because the =( ) splits on IFS i.e. space and newline.

If there is a cyclic shift, the % operator (modulo) is nice!
The following...
198
Posted By Don Cragun
Assuming that $OPTIONS does not expand to a...
Assuming that $OPTIONS does not expand to a string containing anything other than alphanumeric characters and <space>s, one could also use:
echo $(echo $OPTIONS|tr ' [:upper:]' '\n[:lower:]'|sort...
243
Posted By MadeInGermany
grep is simple stupid, but maybe good enough? ...
grep is simple stupid, but maybe good enough?
grep -E "interface|ip helper-address" file

--- Post updated at 20:20 ---

A simple sed solution (works like the awk sample in post #2)
sed...
191
Posted By jim mcnamara
One of our developers unleashed this very fork...
One of our developers unleashed this very fork bomb. On a development box. Fortunately developers did not have shell level access to production. There is a special account to fix prod problems. ...
191
Posted By Scrutinizer
Hi, this is one of the most well known "fork...
Hi, this is one of the most well known "fork bombs". The use of ":" as a function name will work in bash or zsh, but not in most other shells. It is an unlimited recursive function that keeps calling...
194
Posted By Don Cragun
That is not surprising. In post #1 in this...
That is not surprising. In post #1 in this thread you said you had CSV input files and used an example that used <tab> characters as the character that separates values. The code RudiC provided...
106
Posted By wisecracker
Perhaps: sambamba -h -f bam -t 10...
Perhaps:
sambamba -h -f bam -t 10 --subsampling-seed=50 -s $fraction ${id}.bam -o ${id}.out.bam
Showing results 1 to 25 of 500

 

Featured Tech Videos

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