Search Results

Search: Posts Made By: mjf
4,158
Posted By MadeInGermany
-prune does not only suppress output, it really...
-prune does not only suppress output, it really skips(prunes) these directories.
-o is logical OR, in a sequence has the meaning of "otherwise"
-a is logical AND, and can be omitted (is implicit),...
1,298
Posted By Don Cragun
clx and mjf, Note that $1 in a and the...
clx and mjf,
Note that $1 in a and the discussion in the referenced thread provide a test for exact matches, but $1 ~ /COMS|SMAS|MARC/ is testing for substring matches. In other words, if the first...
2,108
Posted By MadeInGermany
Actually you don't need to store the long $0 in...
Actually you don't need to store the long $0 in memory,
map[$1]=1 is enough.
Most awk can store even nothing, and can lookup elements without defining them if not found
awk 'FNR==NR{map[$1];next}...
2,944
Posted By Don Cragun
It is because the ++ in count[subscript]++ is a...
It is because the ++ in count[subscript]++ is a post-increment operation. That expression returns the value it had before the value is incremented and then increments the variable to the new value. ...
2,465
Posted By Don Cragun
Hi mjf, $2 is not being set to $1. If $1 is...
Hi mjf,
$2 is not being set to $1.
If $1 is present as an index in E[] ($1 in E), $2 is being set to E[$1]; otherwise $2 is being set to the string No Match.
1,430
Posted By bakunin
Both are working, but you should use Dons...
Both are working, but you should use Dons suggestion in favour of mjfs: there is a mechanism called "process substitution" in bourne-like shells (Bourne-Shell, bash and ksh, to name the most popular...
25,303
Posted By Don Cragun
You could also try: nohup sh -c 'date;cp -rp...
You could also try:
nohup sh -c 'date;cp -rp /files/source /files/target;date' 2>&1 > cplog &
3,470
Posted By Don Cragun
Suppose that you have two records in a file with...
Suppose that you have two records in a file with '|' as the field separator:
ab|c
a|bc
and you want to count the number of occurrences of different settings in the 1st two fields.
awk -F '|' '
{...
9,032
Posted By Yoda
Another approach: find . -name "test*.txt.Z"...
Another approach:
find . -name "test*.txt.Z" -exec zcat -v {} \; 1>&1 2>&1 | awk ' {
sub(/[ \t]+[0-9]+\.[0-9]%/,x,$0)
r = match($0, /\..*:/)
if(r) {
f =...
9,032
Posted By Chubler_XL
Try: find . -name "test*.txt.Z" -print | awk...
Try:

find . -name "test*.txt.Z" -print | awk '{F=$0; while(("zcat "F| getline) > 0) print F, $0; close("zcat "F)}'or

find . -name "test*.txt.Z" -print | while read FILE
do
zcat "$FILE" |...
1,556
Posted By alister
wc counts the number of newlines. If one of the...
wc counts the number of newlines. If one of the files doesn't end in a newline, that would explain the discrepancy, since awk would add the missing newline when it prints that record.

Regards,...
72,350
Posted By radoulov
You'll need to either print the fields one by one...
You'll need to either print the fields one by one or force the reconstruction of the record:

zsh-5.0.0[]% echo a b c d | awk 'BEGIN { OFS = ";" }{ print $1, $2, $3, $4 }'
a;b;c;d
zsh-5.0.0[]%...
Showing results 1 to 12 of 12

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