Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to convert a batch of latex files using catdvi.

The command I use for a single file is:

catdvi -e 1 -U 1.dvi | sed -re "s/\[U\+2022\]/*/g" | sed -re "s/([^^[:space:]])\s+/\1 /g" > 1.txt

However, I want to run the same command on all files from 1.dvi to 30.dvi. When I did:

for f in *.dvi ; do catdvi -e 1 -U $f | sed -re "s/\[U\+2022\]/*/g" | sed -re "s/([^^[:space:]])\s+/\1 /g" > "${f%.dvi}.txt"; done;

It gives an error expecting 0 or 1 arguments, got 10, etc.

What change do I need to do to the command?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

The answer to a similar question will apply to here also. So, here is the link:

Batch command that requires output redirection

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.