Benutzerinformationen überspringen
Wohnort: Hagen
Beruf: Mechatroniker (didaktische Systeme)
Rootserver vorhanden: Nein
|
|
Quellcode |
1 2 3 4 |
server@*****:~/publicserver/cssfun$ diff <(find) <(cat ~/serverfiles/css.txt) | wc -l 1365 server@*****:~/publicserver/cssfun$ diff <(find) <(cat ~/serverfiles/css.txt) | grep '^< ' | wc -l 1337 |

|
|
Quellcode |
1 |
diff <(cat ~/serverfiles/css.txt) <(find -type f) | grep '^> ' | sed 's/^> //' | egrep '/orangebox/cstrike/maps/|/orangebox/cstrike/materials/|/orangebox/cstrike/sound/|/orangebox/cstrike/models/' | grep -v '.ztmp$' |
Benutzerinformationen überspringen
Wohnort: Hagen
Beruf: Mechatroniker (didaktische Systeme)
Rootserver vorhanden: Nein
Benutzerinformationen überspringen
Wohnort: Schwelm
Beruf: Immobilien-Verwalter / Serveradministrator
Rootserver vorhanden: Nein
|
|
Quellcode |
1 |
".inf\|.log\|.txt\|.cfg\|.vdf\|.cache\|.dem\|.db\|.dat\|.ztmp\|log\|logs\|download\|downloads\|DownloadLists/\|metamod/\|amxmodx/\|hl/\|hl2/\|cfg/\|addons/\|bin/\|classes/" |
Benutzerinformationen überspringen
Wohnort: Hagen
Beruf: Mechatroniker (didaktische Systeme)
Rootserver vorhanden: Nein
? Benutzerinformationen überspringen
Wohnort: Hagen
Beruf: Mechatroniker (didaktische Systeme)
Rootserver vorhanden: Nein
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
bz2include() {
if [ $# = 1 ]; then
echo -n "-name *.$1"
return
fi
output="\( -name \*.$1"
shift
for type in $@; do
output="$output -o -name \*.$type"
shift
done
output="$output \)"
echo -n "$output"
return
}
|
|
|
Quellcode |
1 |
bz2_include_filetypes="nav bsp mp3 wav vtf mdl txt" |
|
|
Quellcode |
1 2 |
find $(bz2include $bz2_include_filetypes) #Fehler, wenn ich die Klammern aus der Funktion nehme, geht es include="$(bz2include $bz2_include_filetypes)"; find $include #Geht natürlich auch nicht. |
|
|
Quellcode |
1 |
\( -name \*.nav -o -name \*.bsp -o -name \*.mp3 -o -name \*.wav -o -name \*.vtf -o -name \*.mdl -o -name \*.txt \) |
|
|
Quellcode |
1 |
-name \*.nav -o -name \*.bsp -o -name \*.mp3 -o -name \*.wav -o -name \*.vtf -o -name \*.mdl -o -name \*.txt |
|
|
Quellcode |
1 |
bash -c "find /home/server/bash_test $(bz2include $bz2_include_filetypes)" |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#!/bin/bash
bz2_include_filetypes="nav bsp mp3 wav vtf mdl txt"
#bz2_include_filetypes="nav"
bz2include() {
if [ $# = 1 ]; then
grep ".$1$"
return
fi
output=".$1$"
shift
for type in $@; do
output="$output|.$type$"
shift
done
egrep "$output"
return
}
find | bz2include $bz2_include_filetypes| while read file; do
bzip2 -kv $file
done
|
Benutzerinformationen überspringen
Wohnort: Hagen
Beruf: Mechatroniker (didaktische Systeme)
Rootserver vorhanden: Nein
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
#!/bin/bash
exclude_filetypes="txt sh bin"
include_filetypes="txt bin sh"
findexclude() {
if [ $# = 1 ]; then
echo "-not -name "*.$1""
return
fi
output="-not \( -name "*.$1""
shift
for type in $@; do
output="$output -o -name "*.$1""
shift
done
output="$output \)"
echo "$output"
return
}
findinclude() {
if [ $# = 1 ]; then
echo "-name "*.$1""
return
fi
output="\( -name "*.$1""
shift
for type in $@; do
output="$output -o -name "*.$1""
shift
done
output="$output \)"
echo "$output"
return
}
exclude="$(findexclude $exclude_filetypes)"
include="$(findinclude $include_filetypes)"
echo "Pattern for exclude: $exclude"
echo "Pattern for include: $include"
echo
echo "Searching files with exluding some filetypes: $exclude_filetypes"
eval find $exclude
echo
echo "Searching files with including some filetypes: $include_filetypes"
eval find $include
echo
echo "Find only real files: -type f (with excluding other files)"
eval find -type f $exclude
|