Hello Christian, *,
On Fr, 2. Mai 2014 12:46 Christian Lohmaier wrote:
> On Thursday, May 1, 2014, Thomas Hackert
<thack...@nexgo.de<javascript:_e(%7B%7D,'cvml','thack...@nexgo.de');>>
> wrote
[randomly sending documents to devs]
>> sigh ... Maybe I will find the time this weekend, and than I will
>> try to join IRC.
> 
> No need to sigh - just meant as it is just not nice to just
> randomly mail documents to people without asking first. That

I would not mail documents randomly to our devs .... ;) I just 
wanted to find out, who of the devs is responsible for the master 
document code to ask him, if it is OK to send it after I have 
explained the problem to him ... ;)

> basically means "I expect you to fix it, no matter how many other
> things you need to do" and that's just not nice.

He, do you really think, I am that evil ;?

> IRC just is easiest medium for quick feedback regarding this -
> you're not forced to used IRC.

It depends: I remember times during bug hunting parties, where you 
have to wait, until someone ansered there ... :( Then again ... This 
is the same with mail ... ;)

>> [discus, disk or something else?]
> 
> Ring, CD, but not discus or disk - that is misleading. And write
> that it is one with big radius, otherwise the screenshot in the
> bug doesn't make it clear what is being talked about.
> And no need to rewrite the comment again.

O.K.

[How to find a string in one ODT]
>> > for file in *.odt; do cp -f my-one-sample.odt "$i"; done
>> >
>> > i.e. for each file U1.... whatever, it copies (and overwrites,
>> > that's what the -f switch does) a single document, in this case
>> > "my-one-sample.odt". over the file.
>>
>> I get an
>> <quote>
>> cp: cannot stat 'my-one-sample.odt': No such file or directory
>> </quote>
>> here ... :(
> 
> Well - that is the placeholder for the one filename you want to
> use. Obviously I have no idea how you name your documents / how
> the documents in the example are all called :-)

But ... I understood this command that way, that it will create "my-
one-sample.odt", if it does not exist. And this was my intention :) 
I just copied your example as is to prevent any typos ... ;) Does it 
mean, that I have to create this file beforehand?

>> > but it might just be a drawing shape.
>> >
>> > for file in *.odt; do zipgrep  'draw:type="ring"' "$file"
>> > >/dev/null && echo "Ringshape in file $file"; done
>>
>> Again, only an error message:
>> <quote>
>> bash: syntax error near unexpected token `&&'
>> </quote>
> 
> PS: - Just use a blank line - that makes it easier to parse
> quickly (at least for me :-)) the lenghty "<quote>" isn't
> necessary.

O.K.

> And yes, it is a copy'n'paste error. the whole commans is meant to
> be put on a single line.
> And it is meant to be run from the directory where all the odts
> are - otherwise the "*.odt" won't match anything.

I had run it in the directory with all the odt files ... ;)

> for file in *.odt;
> 
> means get a list of all files with odt extension and run a loop
> with it. For each file you encounter, assign the filename to the
> variable "file"

O.K.

> do zipgrep  'draw:type="ring"' "$file" > /dev/null && echo
> "Ringshape in file $file"
> 
> means: for each file, run the command "zipgrep". Search for the
> string 'draw:type="ring"' in the file named $file (that is where
> we reuse the variable define in the previous part), and discard
> the output if it matches (redirect stdout to /dev/null , that is
> the "> /dev/null" part. content.xml has no linebreaks, and when
> the zipgrep matches, it would pint a huuuuge line to the terminal
> that we're not interested in anyway. If zipgrep did find
> something, then output the name of the file with the echo
> statement.

Ah, O.K.

> && means. If the previous command returned without error, then run
> the second one.
> || would be the opposite: if the previous command returned with
> || error (in
> the case of zipgrep: string wasn't found), then run the second
> one. ; is the third way: No matter whether previous command was
> successful or not, just run the second one anyway.

O.K.

> done
> 
> marks the end of the statement that should be repeated. so
> everything between the "do" and "done" is executed for each file.

O.K. Thank you for your crash course with Bash oneliners :)

> ... :( First I thought, some kind of c&p errors with your
> commands,
>> changed any quotation mark and inverted comma, but this does not
>> solve the problem ... :( /me thinks, I should learn a little bit
>> more of these Bash internals ... ;)
> 
> Wouldn't hurt to know some basic shell-scripting :-))

Sure :) Just need an easy to understand and fast too read guide ... 
;) And one, which is not a shell scripting guide, but only an 
advanced luser guide ... ;)

But still, if I use your example as a oneliner, I get

zipinfo:  cannot find or open , .zip or .ZIP.
/usr/bin/zipgrep: 97: test: -eq: unexpected operator
/usr/bin/zipgrep: 100: test: Illegal number:

as an message ... :( Does this mean, zipgrep does not recognize ODTs 
as zip files? Do I have to either change all file extensions to zip 
instead of odt, or find some kind of file to tell zip(grep), that 
ODTs are also zip files?

And I have looked at line 97 of /usr/bin/zipgrep. There is the line

if test $list -eq 1; then

. How should this line look to circumvent this error message? And 
why is "100" an illegal number?
Sorry for the inconvenience
Thomas.

-- 
I value kindness to human beings first of all, and kindness to 
animals. I don't respect the law; I have a total irreverence for 
anything connected with society except that which makes the roads 
safer, the beer stronger, the food cheaper, and old men and women 
warmer in the winter, and happier in the summer.
                -- Brendan Behan

_______________________________________________
List Name: Libreoffice-qa mailing list
Mail address: Libreoffice-qa@lists.freedesktop.org
Change settings: http://lists.freedesktop.org/mailman/listinfo/libreoffice-qa
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://lists.freedesktop.org/archives/libreoffice-qa/

Reply via email to