Last change
on this file since 138 was
138,
checked in by rosiere, 14 years ago
|
1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
File size:
1.0 KB
|
Rev | Line | |
---|
[138] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | function usage () |
---|
| 4 | { |
---|
| 5 | echo "${0} params"; |
---|
| 6 | echo "erase line with params"; |
---|
| 7 | exit 1; |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | function del_param () |
---|
| 11 | { |
---|
| 12 | local file=${1}; |
---|
| 13 | shift; |
---|
| 14 | local -a params=(${*}); |
---|
| 15 | |
---|
| 16 | # no separator |
---|
| 17 | SAVEIFS=${IFS}; |
---|
| 18 | IFS=""; |
---|
| 19 | |
---|
| 20 | while read line; do |
---|
| 21 | |
---|
| 22 | local find=0; |
---|
| 23 | |
---|
| 24 | for param in ${params[*]}; do |
---|
| 25 | local count=$(echo "${line}"| grep -c ${param}); |
---|
| 26 | |
---|
| 27 | if test ${count} -ne 0; then |
---|
| 28 | find=1; |
---|
| 29 | break; |
---|
| 30 | fi; |
---|
| 31 | done; |
---|
| 32 | |
---|
| 33 | if test ${find} -eq 0; then |
---|
| 34 | echo "${line}"; |
---|
| 35 | fi; |
---|
| 36 | |
---|
| 37 | done < ${file}; |
---|
| 38 | |
---|
| 39 | IFS=${SAVEIFS}; |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | function del_file () |
---|
| 43 | { |
---|
| 44 | local file=${1}; |
---|
| 45 | |
---|
| 46 | echo " * ${file}"; |
---|
| 47 | del_param ${*} > tmp; |
---|
| 48 | mv tmp ${file}; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | function del_files () |
---|
| 52 | { |
---|
| 53 | for file in *.cfg; do |
---|
| 54 | del_file ${file} ${*}; |
---|
| 55 | done |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | function main () |
---|
| 59 | { |
---|
| 60 | if test ${#} -eq 0; then |
---|
| 61 | usage ${*}; |
---|
| 62 | fi; |
---|
| 63 | |
---|
| 64 | echo "delete parameters : ${*}"; |
---|
| 65 | |
---|
| 66 | # del_param debug.cfg ${*}; |
---|
| 67 | del_files ${1}; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | main ${*}; |
---|
| 71 | #del_param debug.cfg ; |
---|
| 72 | |
---|
Note: See
TracBrowser
for help on using the repository browser.