Script with find and ex

i want to run a utility from the terminal for all the files in a directory. The utility has an input file name and output file name as parameters. The filenames have spaces and the utility is not taking the names. Can someone help me with a script where i can do the following
find . -name *.opus
for each of the files found above I need to run this command
opusdec "name of the file form above find" "name of the file from above find with an extention wav"
I wrote this script but it is not working
ListOfFiles=`find .  -name *.opus
for i in $ListOfFiles
do  
    optfile="${i}.wav"
    ./opusdec $i outfile
done
thanks for your help.

Looks like you're missing a backtick
     Change ListOfFiles=`find .  -name *.opus to ListOfFiles=`find .  -name *.opus`
$() is preferred.  Try
     ListOfFiles=$(find .  -name *.opus)

Similar Messages

  • A Script to Find and Replace Layer Names

    Are there any scripts to find and replace layer names?
    There is an excellent script available for Photoshop which allows you to not only replace words in layer names, but also insert words as Prefixes, Suffixes and Sequential Numbers.
    The illustrator version of this script only allows sequential numbering: It doesn't offer find and replacing of words.
    Ideally, it would be great if there was something that could do multiple find and replaces in one go:
    (e.g.
    You have layers like this Car, Dog, Bat
    You enter: car(Option1), dog(Option2), Bat(Option3)
    Your layers then become: Option1, Option2, Option3).

    big_smile, that's a very good start! Step 1 of Learning How To Script is indeed, adjusting an existing simple script to make it do more complicated things. (And usually then "break something", which is also a required part of the process.)
    You are correct in your observation this is repetitive stuff. For one or two different items that wouldn't be a problem, but in longer lists you soon get lost.
    The usual way of working with find-change lists is to build an array:
    var layernames = [
    [ 'FHairBowlBoy *Hair', 'Hairboy1' ],
    [ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
    [ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
    The general idea is to loop over all names, check if the current layer name is "layernames[i][0]" (the left column) and if so, rename it to "layernames[i][1]" (the right column). If you know how to write a loop in Javascript, then you can implement this right away.
    However ..
    A more advanced way to do this doesn't even need loop to over all layernames -- instead you can immediately "get" the correct name per layer! It's magic! Almost!
    The trick is to use a Javascript object instead of an array. Javascript objects are nothing special; Illustrator's 'layers' is an array of objects, and each object "layer" has a property "name", whose value you can read and set. What I do here is create a new object, where the "name" part is the original layer name and its value is the new layer name. All you need to check for per each layer is if there is a property 'object.originalLayerName', and if so, assign its value to that layer name.
    This looks a bit like the array above, except that (1) you use {..} instead of [..] to create an object, and (2) you add "name:value" pairs instead of "value" only (actually, the 'name' of a value in an array is simply its number).
    So this is what it looks like:
    // JavaScript Document
    var doc = app.activeDocument;
    // name indexed object
    var layernames = {
    'FHairBowlBoy *Hair':'Hairboy1',
    'FHairCurlyafroBoy *Hair':'Hairboy2',
    'FHairSpikyBoy *Hair':'Hairboy3'
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++)
    //Set up Variable to access layer name
    var currentLayer = app.activeDocument.layers[i];
    if (layernames[currentLayer.name])
      currentLayer.name = layernames[currentLayer.name];
    Enjoy!

  • Aborting index build. Too many errors with finding and copying files ...

    Hi dears,
    I'm using UCM 11g.
    I'm trying to start the automatic update cycle. When i start it, it gives me an error message just like :
    Indexing aborted at :<time>. Aborting index build. Too many errors with finding and copying files to the appropriate place.+
    Can anybody help me about this problem?
    Helps will be appreciated.
    Erdo
    Edited by: erdo on 28.Mar.2013 11:11

    Read this: error in Collection Rebuild Cycle
    and maybe also UCM Indexer - Collection Rebuild Cycle errorring out

  • Possible bug in inDesign CS5 with find and change

    This could be a problem with my script or it may be a bug, not sure.
    The script is used for finding a double space in a fragment of text and changing it to single space.
    It works only once when it is executed.
    To make it work again you have to close and reopen inDesign.
    Here's the code:
    app.findTextPreferences.findWhat = "  ";
    app.changeTextPreferences.changeTo = " ";
    app.documents[0].changeText();

    This one worked, Harbs also works but I think I'll go the unicode grep route for find and change on this one.
    I like the use of the positive lookbehind GREP character. (?<=) 
    thank you

  • Is there a script to find and replace glyphs?

    I am using Adobe Illustrator CC 2014, Build 10.1.0.70.
    I am looking for a way to quickly find and change certain glyphs within a typeface much like InDesign's Find/Change feature with a script that runs through saved queries. Is this at all possible..?

    Hi Steve, thanks for your quick response.
    My apologies I should've made myself clearer... I was more thinking about a script to run a chain of preset saved find and replace queries together. I have 48 individual glyphs from one typeface that I need to consistently apply across whole ducunents. Rather than click through each glyph for every single document I come across I was hoping there was a way to automate the process.
    Thanks

  • Script to find AND repair missing links on Mac

    I'm looking for a script that both finds the "missing tracks" in my iTunes media music folder for songs that iTunes itself shows as missing with "!" AND also repairs them. I know there's a dougscript for finding the tracks that are missing but from the explanation I can't see that it fixes them. I want something that can do batches of a couple hundred tracks rather than one by one, when iTunes offers to locate and then use location to find other tracks, it only looks in that specific artist's album folder.

    I think it will add whatever you select.  When it finds the tags do not match it will simply update the tags in the iTunes database and your original entry will have essentially disappeared.  When you add a file iTunes enters tags in its database but if you activate the file iTunes will double check its entry against the file's entry it will update its entry to match the files if they are no longer the same.
    The above will accomplish what you wish but it will have to be done one entry at a time which could be tedious.  Frankly I would consider how long it will take to rebuild your playlists if you just import your PC's library, add the lossless files, and hash out a method for dealing with the things you want to replace.  You could, for example, add all the new lossless files to each playlist, find duplicates, delete the mp3 versions (just from the playlist) that are duplicates, sort so all the "duplicate" lossless files (which are now replacements for the mp3s) are at the top of the playlist, show all so the non-duplicate lossless files are at the bottom of the list and delete those.  Your playlist now consists of just the lossless versions of files that matched mp3 versions.  After you have done all this, clean up your library and computer of unwanted mp3 files.  No, that isn't s super detailed summary but I am not going to type it all in super detail step-by-step unless you really need it.

  • Dumb Q: problem with Find And Replace window in Flash 8

    Dear Flash Group,
    apologies if this is trivial, it's my first day using Flash.
    I downloaded a Flash project from
    http://www.flashorb.com/articles/benchmark_files/flash-benchmark.zip.
    This
    flash calls into a web service at localhost:8080. I used the
    'Find and
    Replace' window within Flash Professional 8 to locate the
    string
    'localhost:8080' and replaced it with plain 'localhost'.
    However, when I 'Debug the Movie' (Ctrl-Shift-Enter), it
    still tries to
    access port 8080! Obsiously, my replace command did not do
    what I thought it
    would do. I opened the FLA file in a binary editor, and saw 4
    more
    references to 8080, One if them in 'Properties' of a
    WebServicesConnector,
    but I cannot figure out how to find the other occurences.
    Checking on google, I see lots of people having similar
    problems, but no
    solutions
    Any ideas?
    Regards, /george
    PS. What do you guys do for code completion - is there a tool
    that would
    bring Flash on par with an professional IDE?

    george,
    > when I 'Debug the Movie' (Ctrl-Shift-Enter), it still
    > tries to access port 8080! Obsiously, my replace
    > command did not do what I thought it would do.
    Agreed.
    > I opened the FLA file in a binary editor, and saw 4
    > more references to 8080, One if them in 'Properties'
    > of a WebServicesConnector, but I cannot figure out
    > how to find the other occurences.
    Might they be the result of that WebServicesConnector
    reference?
    > Checking on google, I see lots of people having
    > similar problems, but no solutions
    That's really odd, actually. I'm on these boards every day,
    and I've
    never heard of this issue. I don't *think* the Find/Replace
    dialog visits
    panel contents, such as the Component Inspector panel, but I
    wouldn't swear
    to that.
    > What do you guys do for code completion - is there
    > a tool that would bring Flash on par with an
    professional IDE?
    Well, Flash is a professional IDE, of course. By definition,
    if you pay
    for something, you have acquired a professional product or
    service. I know
    what you mean, though. Flash itself rocks, but the Actions
    panel can be
    glaringly weak. Personally, I use SE|PY to edit ActionScript.
    http://www.sephiroth.it/python/sepy.php
    Sorry I can't speak to your other issue. :-/
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Dyanamic table is SAP Script with horizontal and vertical lines

    Hi,
    I need to display the data of the table in the SAP script which is having both horiziontal and vertival lines.
    the out put needs to looks as it in Excel...where there are multiple records with 5 fixed coulmns each seprated from one another by horizonalt and vertical lines..
    I thinking about useing the Box with XPOS and YPOS who value changes dynamicaaly..
    But again as the number of pages might be more than one..i think there will issues,
    Can you  let me know how to proceed in SCRIPT ,,,, where the number of records might vary ..and also ..it might continue to second page..
    Regards
    Senthil

    well it is possible but quite tricky.
    All you got in SAP-SCRIPT to achieve this is the BOX-Statement.
    The BOX statement works with variables for XPOS, YPOS, WIDTH and HEIGHT. what you need to do is:
    - calculate those variables during runtime
    - add box-statements with those variables.
    to calculate those variables you need to count used lines and so on. i hope i showed you a way, rest is a lil brainwork then.
    regards

  • Creating an executable script with vi and chmod

    I have some after market packages I want to set up in my MBP Mavericks. I create a script file in iv called runada. It adds some directories to the global $PATH variable. I then change rights on the script, runada, with 'chmod a+x runada' so it becomes an execuitble. But it fails when I call runada within a shell terminal. I have seent his work in Debian I think.

    As a guess: PATH needs to be exported if you want that setting to persist after the script modifies it and exits, or you'll need to "." or "source" invoke the script.
    In any case, post a reproducer of the bash and somebody here can have a look.
    Using homebrew is another approach to rolling your own packaging (if that's where you're headed here), and there are various alternatives to that.

  • Scripting with FTP and HTTP

    Hi All,
    To help us with future planning, we would like to get a feel for how many developers are using the FTP and HTTP objects that are available with scripting in CS3 (through webaccesslib). If you are using them could you send me a quick email describing how you use the component? My email address is [email protected]
    Thanks in advance.
    Alan Morris
    Dev Tech Engineer
    Adobe Systems

    Yeah, this is so aggrevating!
    Adobe builds all of these cool ideas, then doesnt test them.
    The HTTPConnection object does not do POST at all. I have tried nearly every possibility. The documentation is either way off or the object just does not work. I can see the post in raw form and the POST variables are not coming across.
    After working on this for a few hours i thought to myself, hey maybe i should just create a flash pane instead and load the files into it, then have the flash object upload. Well i ran into a big fat wall there too! As it is with patchpanel and bridge, these technologies only accept swf objects. This whole concept of using SWF and crossscripting has a huge flaw. The SWF file's security format does not allow for local file access for doing simple things like upload. If i can't synchronize file data to web based clouds, then i cant do much worth talking about.
    I love these products and their possibilities but i have to have the ability to communicate with the world. HTTP is the way!
    Also a side note, FTP is an insecure/inflexible solution and looks like a lot more time was spent on this aspect of the scriptable product.
    PLEASE HELP ADOBE!!!!!

  • Need Help With find and Replace

    I am a little green to this all. I am trying to find and
    replace a word inside the edit region and Dreamweaver will not
    change it, because it says its inside a locked region, but its a
    editable region?
    I have about 900 pages I need to make this change on and was
    relying on the find and replace tool to do that. I tried differn't
    advanced options, nothing seams to change it. I am using cs3.
    Thanks for any help

    Using Templates with a 900 page site is a crime against
    humanity. You reach
    the optimal size for Templates between about 50 and 100.
    The error you are getting suggests that there are coding
    errors on the page
    (perhaps even unrelated to ANY DW Template markup). We'd need
    to see the
    page to make progress with what that might be, as Alan says.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "RyanWaters" <[email protected]> wrote in
    message
    news:ggs7fq$gnq$[email protected]..
    >I am a little green to this all. I am trying to find and
    replace a word
    >inside
    > the edit region and Dreamweaver will not change it,
    because it says its
    > inside
    > a locked region, but its a editable region?
    > I have about 900 pages I need to make this change on and
    was relying on
    > the
    > find and replace tool to do that. I tried differn't
    advanced options,
    > nothing
    > seams to change it. I am using cs3. Thanks for any help
    >

  • Afconvert with find and exec.

    So I'm trying to make a recursive command to find and convert all .mp3 files to .m4a.
    This is what I have this far for a few tries:
    afconvert -d 'aac ' -f 'm4af' *.mp3 new1.m4v
    find . -name "*.mp3" -exec afconvert -d acc -f 'm4af' *.mp3 *.mv4 {} \;
    I know *.mv4 may not be the best wildcard to use.
    Thanks much
    Josh

    Let's talk about your wildcard expansion. In your first attempt -
    afconvert -d 'aac ' -f 'm4af' *.mp3 new1.m4v
    The shell attempts to expand every file that ends in .mp3 into the arguments of the command. Something like-
    afconvert -d 'aac ' -f 'm4af' file1.mp3 file2.mp3 file3.mp3 new1.m4v
    According to the sparse manual and overly verbose help option the command accepts one source file and an optional outfile name.
    In your second attempt, you are attempting to expand file names within find's exec function. This function is not a shell so wildcards are meaningless.
    find . -name "*.mp3" -exec afconvert -d acc -f 'm4af' *.mp3 *.mv4 {} \;
    The enclosing parenthesis "{}" contain the file name. You do not need to have a outfile name. afconvert will automatically name the file with the m4a extension. This should work- Of course, Use at Your Own Risk.
    find . -name "*.mp3" -exec afconvert -d acc -f 'm4af' {} \;

  • UNIX scripting with id and password in clear text

    Hi
    I have a shell script to connect and do several PLSQL.
    how can the script doing it without the ID password in cleartext?
    i.e.
    #!/bin/sh
    conn id/password ....

    If you create an operating system authenticated user, you connect to the database without a password, i.e.
    sqlplus / is sufficient (assuming the script is running as the appropriate operating system user). Tom Kyte talks about this here
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1477204811604
    There are examples of using DBMS_SCHEDULER to invoke operating system scripts on Tim Hall's site
    http://www.oracle-base.com/articles/10g/Scheduler10g.php
    Justin

  • Help with find and replace regex

    Hello.
    I have a page listing about 50 services that have named
    anchors to a
    glossary page. Something like this:
    <a href="/glossary.html#Blogging">Blogging</a>
    And what I need is to have the glossary open in a new window.
    So how
    do I write a regex that will give me:
    <a href="/glossary.html#Blogging"
    taget="blank">Blogging</a>
    Thanks for any help
    Lance

    Thanks Brendon.
    It's Regular Expression; an optioin in the find and replace
    dialog.
    I've got to replace 50 of these anchors, each different.
    <a href="/glossary.html#Blogging">Blogging</a>
    <a href="/glossary.html#yadayada">yadayada</a>
    etc.
    to make them each open in a new window.
    <a href="/glossary.html#Blogging"
    taget="blank">Blogging</a>
    L.
    On Thu, 18 Oct 2007 14:40:46 +1300, "Brendon"
    <[email protected]>
    wrote:
    >Whats a regex?
    >Why not just do a Find and Replace? Specify the current
    local site, and
    >voila. Make sure you spell target correctly though ;-)
    >
    >
    ><@networkologist@@gmail.com> wrote in message
    >news:[email protected]..
    >> Hello.
    >>
    >> I have a page listing about 50 services that have
    named anchors to a
    >> glossary page. Something like this:
    >>
    >> <a
    href="/glossary.html#Blogging">Blogging</a>
    >>
    >> And what I need is to have the glossary open in a
    new window. So how
    >> do I write a regex that will give me:
    >>
    >> <a href="/glossary.html#Blogging"
    taget="blank">Blogging</a>
    >>
    >> Thanks for any help
    >>
    >>
    >>
    >> Lance
    >

  • Scripting with FCP and compressor

    Hi folks,
    I run a video transfer business, therefore, my projects are fairly streamlined in terms of the processes.
    After beginning a FCP export to a .mov file so i can compress into a m2v and aiff with bitvice, can i write a script to automatically take the aiffs, launch compressor, choose my created preset ac3 setting and create the ac3s?
    I ask b/c i maximize my time by transferring/editing/colour correcting during the day and i run my files overnight. Most times, the files are done b/n 5 AM and 7 AM, but then my lovely macs sit there, unused for a few hours. I would love to have them grab the necessary files and go to work?
    I would never ask if this is possible on a peecee, but i wouldn't put it past a Mac
    I'm on FCP 4.5, with G5 dually 2.0 and a g4 dual 1.25 MDD.
    thanks in advance for answering either way,
    Keebler
    G4MDDdual1.25; G5 dual 2.0   Mac OS X (10.3.9)  

    i think you could do this quite easily, the basic steps would be:
    in the Finder, create a Folder on the Desktop called "Converted Files" or something like that
    in Compressor, choose your preset and set the Destination to your "Converted Files" folder ... then save this setup as a Droplet
    now create a "Folder Action" applescript, to open any files contained in the folder with your Droplet, and attach the action to your "Converted Files" folder
    then export your aiff's to this folder and the compressor action will run automagically
    you might also want to check out Automator in your Aplications folder

Maybe you are looking for

  • 3 Dots in Corner Of Day Box in Month View

    When in the month view of iCal several days of every month have 3 periods/dots in the upper left hand corner of the day box that can't be deleted. Ever see this and can they be erased. Thanks

  • HT5634 How to Install Windows 7 or 8 on my MacBook Pro

    Welcome once again....I have a really bugging queston....I just got a MacBook Pro with 4GB and 750GB HDD and I want to partition my hardrive so I can use windows 7 or 8 on it... But when i go to the Boot Camp Assistant...This is what it says--Screen

  • Need to add Excel as option on SAP report view (currently only ALV layout)

    Some users currently have the option to view a report in either the standard ALV layout view or as Excel (example output - transaction VA05).  They also have the Excel icon on their toolbar.  Our issue is that not all users have this option in their

  • Programs will not open from Dock

    I have updated my Macbook Pro with Yosemite which has led to - a lot. Programs will not open from Dock, they are just revealed in Finder. Scrolling with mousebuttons in a browser will zoom instead of scroll, the courser will not change after changing

  • Cannot sign into evernote account after 10.1 update

    I just updated to 10.1.0.4189 and can no longer sync remember with Evernote.  The settings app says my password authentication is "expired" but won't allow me to enter a new password.  In the same breath it says my settings do not need to be changed.