Search Results

Search: Posts Made By: royalibrahim
2,007
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...
11,001
Posted By royalibrahim
vi +<nth_occurrence>/<search_pattern> ...
vi +<nth_occurrence>/<search_pattern> <input_file> will solve your problem
4,067
Posted By royalibrahim
Should be comm -23 <(sort a) <(sort b)
Should be comm -23 <(sort a) <(sort b)
2,854
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,898
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 08:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy