Closed joelpurra closed 10 years ago
This is cool. Do you plan on making it portable so that it can be merged in? The thing to remove whitespace should be safe already. The other one can be done by wrapping sed in its own function that tries to run it with one argument, and runs it with the other if it fails.
@EtiennePerot: not what I planned to do, but since you seem to approve of the general approach, I did.
Now, if I could only get torsocks
to work properly so I can actually use this script ;)
not what I planned to do, but since you seem to approve of the general approach, I did.
Do you mean you didn't plan to submit changes, or that you planned to make them some other way?
Closing this as #2 should be the main thread for this now.
@EtiennePerot: was pressed for time late Friday afternoon, and hadn't thought of an easy enough fix for the portable sed
check to submit a complete patch. Your quick reply made me look into it though!
Running
parcimonie.sh
on Mac OSX 10.9 Mavericks (perhaps with custom versions of some tools) failed for me.sed
doesn't have the-r
flag for extended regular expressions, but it has the equivalent-E
flag.expr
didn't want to parse numbers with extra whitespace.Here are the steps taken to fix them:
Editing
parcimonie.sh
to usesed -E
instead, removing/i
ignore case flag etcetera.Testing the commands called from
parcimonie.sh
.Now editing
parcimonie.sh
to remove whitespace around numbers, including newlines/empty lines, keeping only the digits.The changes are present in the mac-osx-fixes-sed-expr branch in my fork. Because this is a quick, non-portable hack, I'm not going to submit a pull request. Hope someone else might find it useful though!