Find the answer to your Linux question:
Results 1 to 5 of 5
Hi how to run a command on all files with the same extension in a directory like this: Code: tex breqn.dtx; tex empheq.dtx; tex flexisym.dtx; tex mathstyle.dtx; tex mathtools.dtx; tex ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    15

    run same command on multiple files with same extension


    Hi

    how to run a command on all files with the same extension in a directory like this:
    Code:
    tex breqn.dtx; tex  empheq.dtx; tex  flexisym.dtx; tex  mathstyle.dtx; tex  mathtools.dtx; tex  mhsetup.dtx; tex  xfrac.dtx;
    but in a simpler manner?

    thank you

    Ps: As you see I am really a newbie!
    I found this:
    Code:
    find . -type f -name *.dtx -exec tex {} \;
    but isn't there something simpler?
    Last edited by louisJ; 11-10-2010 at 11:48 AM. Reason: new info

  2. #2
    Just Joined!
    Join Date
    Oct 2006
    Location
    France
    Posts
    18
    Hello.
    It depends on which action you want to make on those files with tex. Right ?
    (in the mean time tex.ac.uk/cgi-bin/texfaq2html looks like a good site)

  3. #3
    Just Joined!
    Join Date
    Nov 2010
    Posts
    15
    they are scripts runnable by tex, so nothing, just tex file.dtx

  4. #4
    Just Joined! aluminumspleen's Avatar
    Join Date
    Oct 2008
    Location
    Dorm Room, America
    Posts
    59
    maybe this:

    tex *.dtx

    '*' being a wildcard matching anything. is exactly like the "find" except this is a simple way to do it in a single directory.

  5. #5
    Just Joined!
    Join Date
    Nov 2010
    Posts
    15
    Quote Originally Posted by aluminumspleen View Post
    maybe this:

    tex *.dtx

    '*' being a wildcard matching anything. is exactly like the "find" except this is a simple way to do it in a single directory.
    no this just processes the first file, but thanks anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •