Search Results

Search: Posts Made By: spacegoose
2,476
Posted By rdrtx1
for i in new-config-files/*/* #...
for i in new-config-files/*/* # for list of files under new directory/subdirectory
do
[[ -f ${i/new/old} ]] && { # if same file name exists...
5,341
Posted By Don Cragun
Similarly, if you change nezabudka's code from: ...
Similarly, if you change nezabudka's code from:
gawk '{u[$0]; l++} ENDFILE {print length(u), l, FILENAME; delete u; l=0}' * | sort -k1,1n

to:
gawk '{u[$0]; l++} ENDFILE {print l, length(u),...
5,341
Posted By Don Cragun
If you change: gawk '{l[$0]++} ENDFILE {for (i...
If you change:
gawk '{l[$0]++} ENDFILE {for (i in l) {if (l[i]==1) u++;t+=l[i]} print t, u, FILENAME; delete l; u=t=0}' *
to:
gawk '{l[$0]++} ENDFILE {for (i in l) {u++;t+=l[i]} print t, u,...
5,341
Posted By Don Cragun
You might note that the suggestion in post #5 in...
You might note that the suggestion in post #5 in this thread invokes awk (using only standard awk features) once and sort twice producing both of the requested sorted outputs. Unlike some of the...
5,341
Posted By MadeInGermany
The following variant correctly handles filenames...
The following variant correctly handles filenames with special characters:
for f in *; do printf "%s/%s lines are unique in file %s\n" $(sort "$f" | uniq -u | wc -l) $(wc -l < "$f") "$f"; donePost...
5,341
Posted By Scrutinizer
Suggestion with regular awk: awk ' FNR==1...
Suggestion with regular awk:

awk '
FNR==1 {
filenr++
Name[filenr]=FILENAME
}

!Seen[filenr,$0]++ {
Uniq[filenr]++
}

{
Total[filenr]++
}

END {
for(i in Name)
print...
5,341
Posted By Don Cragun
Please always tell us what shell and operating...
Please always tell us what shell and operating system you're using when you start a new thread. Don't assume that everyone who wants to help you has read all of your previous threads.
#!/bin/bash...
5,341
Posted By vgersh99
this is gawk specific AND it does not count the...
this is gawk specific AND it does not count the unique lines correctly.
How about another version:

gawk '{l[$0]++} ENDFILE {for (i in l) {if (l[i]==1) u++;t+=l[i]} print t, u, FILENAME; delete l;...
5,341
Posted By nezabudka
awk '{u[$0]; l++} ENDFILE {print length(u), l,...
awk '{u[$0]; l++} ENDFILE {print length(u), l, FILENAME; delete u; l=0}' * | sort -k1,1n
2,400
Posted By RudiC
Try (untested) awk '{gsub ("/", "-", $NF)}...
Try (untested)

awk '{gsub ("/", "-", $NF)} 1' file
5,942
Posted By disedorgue
Hi, The result in the PIPESTATUS array is the...
Hi,
The result in the PIPESTATUS array is the sub shell return that is the return of the last command of this sub shell (here grep).
A workaround example:
$ date
sam. févr. 7 01:43:32 CET 2015
$...
Forum: IP Networking 03-07-2013
3,130
Posted By Corona688
Run this on machine X: ssh -L 9999:Y:636...
Run this on machine X:
ssh -L 9999:Y:636 username@Z

Once logged in, this should open a port on the machine you run 'ssh' on, so the app running on X can access Y:636 via localhost:9999

If you...
7,675
Posted By rdrtx1
If working with files that are ":" field...
If working with files that are ":" field delimited:


pwds file (pwd:replace pwd):
s/1zg6/2RWAUY,2/lR:@#xyyyy$@#!$@#
JQy74TuvHyqMo:@#$@#!xxxxx$@#
32oVGmESDPBLk:@#$@234234wa#!$@#...
1,918
Posted By methyl
One way of finding all the problem directories: ...
One way of finding all the problem directories:

We first create a list of all relevant directories.
Then extract all case-significant duplicates and re-search the original list for...
Showing results 1 to 14 of 14

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