Find gives permission denied on files when executed from bash script.

I've written a really basic script just to check what new music was added to my library over the past n days:
#!/bin/bash
echo "Check for days?"
read days
`find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print`
If I run the find from the shell it runs fine but the script always gives this error:
./listNewMusic.sh: line 7: /home/MrGone/Music/Smod/SModcast-19.mp3: Permission denied
Anyone know why?
Thanks.

It is because you're running the find command in a sub-shell.  What is returned by the sub-shell is being run by your script.
Change:
`find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print`
to
find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print
Last edited by steve___ (2010-07-10 12:50:38)

Similar Messages

  • How do you export a song in logic pro x. ive tried now for 2 hours to do it and all it gives me and indivial files when i want the whole thing as a project

    how do you export a song in logic pro x. ive tried now for 2 hours to do it and all it gives me and indivial files when i want the whole thing as a project

    Go here:
    http://help.apple.com/logicpro/mac/10/
    Search on   Bounce

  • I get an error stating cc cookies dir: cannot make folder / cookies: Permission denied (error 13) when I attempted to download the creative cloud installer on my Mac. Can anyone help with similar pop up window?

    I get an error stating cc cookies dir: cannot make folder / cookies: Permission denied (error 13) when I attempted to download the creative cloud installer on my Mac. Can anyone help with similar pop up window?  I'm trying to get a trial version of CS5. 

    You do not need to involve Creative Cloud to install/try the trial version of CS5...
    You can download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS5: http://prodesigntools.com/all-adobe-cs5-direct-download-links.html

  • What do I do if I get the message "The iTunes library file is locked, on a locked disk, or you do not have write permission for this file" when I try to open up iTunes?

    What do I do if I get the message "The iTunes library file is locked, on a locked disk, or you do not have write permission for this file" when I try to open up iTunes?

    Read the part about changing permissions on the iTunes folder in: https://discussions.apple.com/message/11583914

  • Applescript in Automator behaves differently when executed from inside Automator, or as an Automator application

    Hello everyone,
    I'm trying to execute an Automator workflow at startup, which I do by saving the workflow as an application, and adding it to the startup list, this works fine.
    My workflow works fine when executed from within Automator (ie clicking on the "Execute" button), but does not anymore when the Automator application is executed (ie. simply double clicking on my Automator file)
    I have narrowed it down to an Applescript inside my workflow which fails only when the application is executed from the finder (the step works fine from within Automator). The script automatically creates an ad hoc wifi network.
    The line which specifically fails is :
    set menu_extras to value of attribute "AXDescription" of menu bar items
    Anyone has any idea why executing the workflow from within automator, and executing it from the finder yield different results ?
    The crazy thing is that all this worked fine up until a few days ago, there might have been an update since (running Mavericks 10.9.2), but nothing game-changing.

    You will need to provide more than the one line of AppleScript you quote if you want a definitive answer.  (We can't even see which app you are addressing this to.)

  • How can I execute a bash script by double clicking in finder

    Hello!
    How can I execute a bash script using finder? Or better: How can I create an alias, which executes my bash script?
    Thanks Johann

    Add the suffix command in your script name. E.g. Script.command.

  • Is there a way to control the quality of my pdf file when exporting from a .pse file?

    Is there a way to control the quality of my pdf file when exporting from a .pse file?
    Hi,
    I have 2 pages in all in a .PSE file.
    When I try to export it as .PDF, the quality is very poor. I cannot change it to a better quality.
    Please advise how I can export the file so that i can have better quality.

    Rik Ramsay wrote:
    To expand a little on what Jongware said, normally choosing vector over bitmap will decrease the filesize. If the vector art is very complex though, this will not be true.
    Yup, a logo as bitmap takes up more space than the same as a vector -- unless the vector image is bitmap heavy (think Drop Shadow, Outline Glow; these are actually bitmap effects).
    Also, check your PDF version. "Older" versions do not support live transparency, the latest do. Then again, you cannot use live transparency if you suspect your viewers may be using Mac OS X, because Apple's own PDF viewer sucks big time.

  • OS command error=13, Permission denied in File Adapter

    Hi All,
    I am trying to call the OS commands in File adaper, when i check the Audit log i am getting Error exectuting the command. the same command when i check in OS its working fine.
    i have collected the debug log and i can see the message saying
    Catching #1#java.io.IOException: java.io.IOException: error=13, Permission denied
         at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
         at java.lang.ProcessImpl.start(ProcessImpl.java:65)
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
         at java.lang.Runtime.exec(Runtime.java:591)
         at java.lang.Runtime.exec(Runtime.java:429)
         at java.lang.Runtime.exec(Runtime.java:326)
         at com.sap.aii.af.lib.util.system.CommandLauncher.exec(CommandLauncher.java:64)
         at com.sap.aii.adapter.file.util.OSCommand.exec(OSCommand.java:58)
         at com.sap.aii.adapter.file.util.OSCommand.exec(OSCommand.java:33)
         at com.sap.aii.adapter.file.File2XI.processFileList(File2XI.java:991)
         at com.sap.aii.adapter.file.File2XI.invoke(File2XI.java:622)
         at com.sap.aii.af.lib.scheduler.JobBroker$Worker.run(JobBroker.java:500)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:169)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:266)
    I hope the problem with problem XI communication with OS level, Could you pls suggest me the problem?
    Thanks,
    Venkat

    Hello!
    You can see more information about os command using the file adapter in SAP note:
    #841704 - XI File & JDBC Adapter: Operating system command
    o  The command line of an operating system command run through the
       File and JDBC Adapter is interpreted slightly different compared
       to common operating system shells. E.g. quotes and apostrophes
       are handled differently. If in doubt, check if the command can be
       successfully run through the Java Runtime.exec(...) API. Also
       note that the command is run as user "<sid>adm" (Unix) /
       "SAPService<SID>" (Windows).
       Under Windows, this especially means that you cannot use any
       shell commands interpreted by teh command processor (such as
       "copy", "ren" or "del") using the operating system command.
    Best regards,
    Franklin

  • Aperture 3.1 can't find/see my Canon RAW files when importing

    Aperture 3.1 cannot see my CANON RAW files when doing import!!!
    Do I really have to re-reference each image in the library if I have moved the library to a different volume? Images are not moved to the library, only referenced.

    You don't want to re-import files if you move the library. You just need to reconnect the masters.
    If you moved the whole thing over at once it should be easy; if you monkeyed with the folder names you could have a lot of work on your hands.

  • Permission Denied Error messgae when using BIAPPLICATIONFRAME

    I am trying to use BIAPPLICATIONFRAME UI to display a Web Application in our Development system but I am getting an error message of Permission Denied in Internet explorer. I have SAP_ALL access in the development system.
    Has anyone come accross this problem and if yes what is the solution.
    Thanks
    Amit

    You do not need to involve Creative Cloud to install/try the trial version of CS5...
    You can download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS5: http://prodesigntools.com/all-adobe-cs5-direct-download-links.html

  • PSE 9 Organizer Slide show can't find the slide show project files after moving from XP to Windows 7

    A bad computer virus forced us to move all our files and programs from XP to Windows 7.  The PSE Editor seems to be working properly, but the Organizer Slide Show can't find the project files.  The structure of each of the 15 slide shows (blank slides) is there and any text I had added, but the pictures and music are missing.  Our computer Tech is not too familiar with PSE and may not have the files in the right spot.  Evidently XP and Windows 7 are organized a little differently and use different names.  He still has all the PSE files from our old hard drive in a folder and probably just needs to know where to put them.         

    +Windows Vista has different file locations than Windows XP+
    This is the problem - the iTunes ITL file from XP is using XP paths, which don't exist in Vista. Here are some directions that have worked for others:
    - Copy your entire iTunes folder --- not just the iTunes Music folder but basically everything under "My Documents" - to external storage
    - Copy those files to your "Music" folder on your Vista system. The end result should be that you have "Documents\Music\iTunes" on Vista, where you had "My Documents\My Music\iTunes" on XP
    - Put a fresh install of iTunes on the Vista system.
    - When you run iTunes for the first time, hold down the Shift key. If it asks you to select a library file, pick the one you just transferred over.
    - The end result should be your library, including all ratings, play counts and play lists, sitting on the new system.

  • Does OS X corrupt files when copying from SD card to desktop?

    Using finder to copy a folder and its files from SD card to mac desktop seems to cause *some* files to be corrupted, specifically a handful of MP4 files from a FAT32 SD card  which was used in a digital camera. Using a binary/hex comparison tool reveals that some segments of the files contents were modified when copied from the SD card. 
    This error occurs when copying multiple files using Finder windows.  However, when copying the same files one at a time, the corruption does not occur.  This appears to be an OS level bug.  In reviewing past content, I found that dozens of MP4 files have been corrupted in the past 4 months by merely copying the files from the SD card to mac desktop using Finder copy/paste.
    I am using OS X Mountain Lion 10.8.3

    Well, like I said, the byte size in fact did *not* change.  So I'm not even concerned about that.  What *did* change is the content of those bytes and it doesn't matter what operating system you are using, the content of those bytes is *not* supposed to change.
    Also, like I said before, if I copy the individual file (MP4) insead of the entire folder, and then do the binary/hex comparison, the byte data is identical. i.e.
    a) copying one file at a time produces an *identical* file on the HD, i.e. the byte count AND the byte content are precisely the same.
    b) copying a folder with multiple files produces a *different* file on the HD, i.e. the byte count is the same BUT the byte content differs from the original file.

  • Missing Audio / Sound in imovie with .AVI files when imported from iphoto

    fortunately i don't need this answered, eventually figured it out my self, just thought it would be helpful to share the solution to this problem as I'm sure others have experienced it. The problem makes more sense when explained chronologically.
    My wife has a Casio digital camera, and had recorded many Movies on it, they all sat in iPhoto all worked fine until i upgraded to Quicktime 7.5, then the audio disappeared. i tried in vain to fix (reinstalled QT 7.5, removed plugins, reinstalled etc.), but to no avail, so i left it - this was all under Tiger, i decided I'd upgrade to Leopard and see if the problem went away.
    Before upgrading to Leopard i got iLife 08, when i first launched iMovie08 it pulled in all the movies from iPhoto, but they too had no sound.
    Then i upgraded to Leopard, now the quicktime missing audio issue got fixed, so i could hear the audio again when launching quicktime via iPhoto (turns out the issue was with how quicktime was handling adaptive PCM audio stream) - i expected all would be fine in iMovie... but it wasnt.
    after much experimentation i realised that i had to force iMovie to re-import all the video from iPhoto, this fixed the issue, but with no obvious way to do this, this is what i did:
    - opened finder, navigated to iphoto library, right click and chose 'show package contents'
    - navigated to the data folder and did a search on this folder only for all movie files (when imovie had originally converted iPhoto movie files into thumbnails it dropped all the thumb size movie files in this folder)
    - deleted all the movie files from the Data folder, making sure not to delete the movie files in any other folders & emptied trash
    - launched imovie, now all the iphoto movies were missing.
    - re-launch iPhoto, whilst holding down shift, option + command keys
    - checked 'rebuild the iphoto library database' only, once done, closed iphoto
    - re-launched imovie, this forced it to re-import all the movies from iphoto
    ... and then the sound was back.
    FYI
    this worked when using...
    OS 10.5.4
    QT 7.5
    iMovie 7.1.4
    iPhoto 7.1.4
    jb

    Hi MGW,
    I do not no how things are handled when using HDV and technical documentation is hard to find on this topic of how photo are handled using HDV but in iMovie and most non HDV video editing software the picture is always 72ppi regardless of what is was/is on the outside and the images that appear the worst are the ones with less.
    On a side note I don't use iPhoto because of all the superfluous files and thumbnails it creates and it disorganises my photos according to criteria that is completely irrelevant to me. I have had these thumbnails pop up in the browser in the past primarily with any photos that existed in the library prior to any updates. With what I have been working on as of late can understand how and why this could happen.
    If you scroll through the media browser dose it appear that the library you are working with duplicates itself somewhere along the line or do you see double images side by side?
    What are you machine specs and please include you screen/display size and graphics card information as this is the most relevant information at this point with what you are doing.
    W1

  • Expdp problem when executing from pl/sql transportable tablespaces

    Hello
    i have a very strange problem for which your assistance is really appreciated. i am applying the transportable tablespaces approach and i have a problem when executing expdp from commandline in comparison to the procedure generated to make the exact same thing.
    more precisely when running:
    expdp etl/etl dumpfile=TBSP090609_DMP.dmp logfile=TBSP090609_DMP.log directory=EXPDP transport_tablespaces=TBSP090609 transport_full_check=y
    the dmp file produced is over 200MB.
    when runng the below pl/sql code the volume produced is around 50MB. any idea what i am missing?
    job_handle :=
    dbms_datapump.OPEN (operation => 'EXPORT',
    job_mode => 'TRANSPORTABLE',
    job_name => 'export_tablespace',
    VERSION => 'COMPATIBLE'
    dbms_datapump.add_file (handle => job_handle,
    filename => dump_file_name,
    DIRECTORY => export_dir_name
    dbms_datapump.set_parameter (handle => job_handle,
    NAME => 'TTS_FULL_CHECK',
    VALUE => 1
    dbms_datapump.metadata_filter (handle => job_handle,
    NAME => 'TABLESPACE_LIST',
    VALUE => '('''
    || tablespace_name
    || ''')'
    dbms_datapump.start_job (job_handle);

    thanx you for your response. the problem was eventually managed to be resolved as follows:
    job_handle :=
    dbms_datapump.OPEN (operation => 'EXPORT',
    job_mode => 'TRANSPORTABLE',
    job_name => 'export_tablespace',
    VERSION => 'COMPATIBLE'
    dbms_datapump.add_file (handle => job_handle,
    filename => dump_file_name,
    DIRECTORY => export_dir_name
    dbms_datapump.set_parameter (handle => job_handle,
    NAME => 'TTS_FULL_CHECK',
    VALUE => 1
    dbms_datapump.metadata_filter (handle => job_handle,
    NAME => 'TABLESPACE_EXPR',
    VALUE => 'IN('''
    || tablespace_name
    || ''')');
    dbms_datapump.start_job (job_handle);

  • Unix script not working when executed from SAP PI communication channel

    Hi Experts,
    I am currently using the Run OS command after message processing functionality of the file adapter.
    However, the unix script doesn't seem to work when run via communication channel.
    The script runs properly when executed manually.
    The communication channel logs don't show any error as well.
    Do you have any ideas as to where the error might be.
    Thanks,
    Mike

    Hi All,
    Thank you for your replies. I appreciate this.
    @Anand, here is the script:
    #!/usr/bin/sh
    #version 1
    hostname=$(uname -a | cut -f 2 -d " ")
    MAILTO="[email protected] "
    homedir=$PWD
    echo $homedir | mailx -m -s "OB10 $hostname" $MAILTO
    /opt/java6/bin/jar -xvf OB10.zip
    ll | mailx -m -s "OB10 $hostname" $MAILTO
    What's puzzling me is that I am able to receive the email alerts.
    This means that the user has sufficient authorization to execute the script.
    But the unzip command is not working.
    I have seen the unzip work when run manually.
    Thanks,
    Mike

Maybe you are looking for

  • Reduce size of all items and text

    I have 2 30-page A4 booklets in which I want to reduce everything by about 15% to increase white space by widening the top and outside margins. The booklets include text and some images, all of which I want to reduce proportionally. I thought of incr

  • Can we Desing a Product Catalog book (100 Pages)

    Hi Gurus, I have the below requirement. I would like to know the advisable tool (BO-Crystal Report, ...Or any....)? We have product Catalog Book (100 Pages). I manually take the Product      -Cost data from SAP FI ECC      -Sales Data from SAP SD ECC

  • Urgent:  EDI Aperak

    Hi, We have an urgent requirement where we have to provide acknowledgement in APERAK format. Entire scenario could be explained as follows: This is an EDI-IDoc scenario where source is EDIFACT D96A and the target is ORDERS05 IDoc.This scenario is wor

  • Providing a "catalog" of available production reports

    Hi, My company is currently looking at providing a method for presenting all our production reports to our end users (probably via Web browser).  Requirements include publishing documentation on the reports useage intent and a list of a report's fiel

  • Planned order Basic dates

    Dear All, The sales order was input by the CSR on today the delivery date entered in the order was next day. Therefore, the planned order should have been todayu2019s date. This would give us enough time to manufacture the product and deliver to the