Search Results

Search: Posts Made By: royalibrahim
1,772
Posted By royalibrahim
awk 'NF {a[$1]+=$2; b[$1]=$0} END {for (i in a)...
awk 'NF {a[$1]+=$2; b[$1]=$0} END {for (i in a) {print b[i], a[i]}}' file
This will give output as..
sam 3 pdf 6
tom 2 ltf 16
ram 5 word 12
Sorry, I could not help you much on how...
10,617
Posted By royalibrahim
vi +<nth_occurrence>/<search_pattern> ...
vi +<nth_occurrence>/<search_pattern> <input_file> will solve your problem
3,938
Posted By royalibrahim
Should be comm -23 <(sort a) <(sort b)
Should be comm -23 <(sort a) <(sort b)
2,534
Posted By royalibrahim
awk 'NR==FNR {a[$1]=$2; next} $2 in a {print $0,...
awk 'NR==FNR {a[$1]=$2; next} $2 in a {print $0, a[$2]}' f2 f1

Please let me know if there is any more cute and compact solution.
2,625
Posted By royalibrahim
The problem is that the loop and ssh (by default)...
The problem is that the loop and ssh (by default) read from the same stdin, and ssh "consumes" (eats) the input to feed it to the remote command, that would otherwise have been read by the loop....
Showing results 1 to 5 of 5

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