Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: home_king
28,804
Posted By home_king
Maybe I catch your word:-) cat file.rpt |...
Maybe I catch your word:-)

cat file.rpt | awk '{dl=NF-1;sum[$dl]+=$NF}END{for(item in sum)print item,sum[item]}'
16,215
Posted By home_king
"Process the file line by line" is just the...
"Process the file line by line" is just the function of awk!
I think you must go over it.

FS="\n", such statement is used just when you want to process file paragraph by paragraph. It may...
6,392
Posted By home_king
Sorry, I couldn't catch your word. Maybe...
Sorry, I couldn't catch your word.
Maybe explain it in detail please?
34,581
Posted By home_king
Re: Simple arithmetic operation
You may go over bash's syntax.
1. It is better to use $() instead of `` in bash, a modern shell.
2. The syntax of Arithmetic expression in Bash: $(())
y=$(($x / 7))
3. No "printf" command ...
16,858
Posted By home_king
It is never said that "daemon+wait" is the only...
It is never said that "daemon+wait" is the only way to make "Co-process" in Bash, but the typical way.
What's more, conceptly, "named pipe" is different from "Co-process". The former depends some...
16,858
Posted By home_king
Well, it's the typical way to make "co-process"...
Well, it's the typical way to make "co-process" in Bash, isn't it? Maybe ksh would be better. But I just know Bash. ;)
2,468
Posted By home_king
Do you mean files with suffix name .l ? Here...
Do you mean files with suffix name .l ?

Here is bash's implementation(Csh is similar to it):

#!/bin/sh
while read -a lfiles -p "Enter files to process:"; do
for file in "${lfiles[@]}";do...
16,858
Posted By home_king
Bash "Co-process" example
It copys one specified file to multiple "unique"(filter those different pathnames which in fact point to the same physical path) paths with parallelism in bash. In contrast to sequential copy...
18,972
Posted By home_king
The complication of the pattern expression is...
The complication of the pattern expression is determined by the situation.
There exists more possibility of modification of it. :-)
18,972
Posted By home_king
sed...
sed 's@<\([^<>][^<>]*\)>\([^<>]*\)</\1>@\2@g'
90,785
Posted By home_king
Just try Gawk! It performs in superior to other...
Just try Gawk!
It performs in superior to other awk's clones.
90,785
Posted By home_king
expr $var1 + $var2
expr $var1 + $var2
11
awk
2,640
Posted By home_king
Re: didn't work
Remember, variable's reference can't be prefixed with $ unless they are position variables like $0~$NF.
Ygor is right. However, you didn't modify your variable reference, so you failed.
Just skip...
11
awk
2,640
Posted By home_king
Just do it when you want to use these external...
Just do it when you want to use these external variables in BEGIN procedure too.
5,629
Posted By home_king
Well, the Bash of modern versions(>=2.0) provides...
Well, the Bash of modern versions(>=2.0) provides a featured concept, called Process Substitution.
However, it works like chaos and functions limitedly.
Anyone can give some advanced way to make...
Showing results 1 to 15 of 15

 

Featured Tech Videos

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