Why does do shell work differntly from running the same bash script in terminal?

i have the following a/s:
set scriptPath to quoted form of ((POSIX path of (path to me)) & lnThumb)       set ftn to ""       repeat            try                 do shell script scriptPath & " " & ppath & " " & ftn                 exit repeat            on error error_message number error_number                  if error_number is not -128 then                      set ftn to (choose file with prompt "select folder thumbnail" default location dir without invisibles)                      set ftn to quoted form of the POSIX path of ftn                 end if            end try       end repeat
calling this bash script:
#!/bin/bash -f   cd "$1"  rm ./folderthumb.jpg   if [ $# -gt 1 ]  then      ft=${2/#"$1"\//}  else      ft=$(awk '/folderIcon=/{printf("%s",$1)}' meta.properties  | sed s/folderIcon=// )      if [ 0$ft -eq 0 ]       then          exit 1      fi      ft="thumbs/"$ft  fi  ln -s $ft ./folderthumb.jpg  exit 0
which works as expected when run from the cli:
tomw> /Applications/imageProc/fixJAlbum.app/Contents/Resources/Scripts/lnThumb.sh `pwd` `pwd`/thumbs/P1040161.JPG   tomw> ls -l folderthumb.jpg lrwxr-xr-x  1 tomw  admin  19 Oct 22 10:36 folderthumb.jpg -> thumbs/P1040161.JPG
but fails to strip the common directory when called from do shell:
tomw> ls -l folderthumb.jpg   lrwxr-xr-x  1 tomw  admin  89 Oct 22 10:36 folderthumb.jpg -> /Users/tomw/Desktop/trip2albequerque/albequerque/oldRailyards2nobHill/thumbs/P1 040133.JPG
w-t-f???

Click on the "Use Advanced editor" on the upper Right of the edit box.
Select the text you want preserved
Click on the >> icon then select "Syntax Highlighting" -> "Plain"
And you will get this
   kind of
output    when    you     post

Similar Messages

  • Running the same sql script in multiple databases

    Hello,
    What is the method to run the same sql script in multiple databases? I want to write a unix script that would select from different databases and run a sql/plsql script in those different databases. What are the ways to write such a unix script? Thank you in advance.

    Just have a parameter which takes in the oracle connection parameters and use it in your sqlplus script with your shell script.
    Your sqlplus script can have a procedure/function call or an anonymous block;
    Then have a wrapper script to call the original script with different connection parameters. Hope this helps.

  • Why does VS2012 install prevent VS2013 from running

    Whilst performing an update to VS2012 (adding the 29MB Office Tools component which can take over 1 hour) does it prevent VS2013 from running?
    When attempting to start VS2013, an error dailogue is displayed stating VS2013 cannot run whilst a setup is in progress.  As these are totally separate applications, why is there this restriction?
    l

    Hello J B Oliver,
    Although they are different versions, they have some shared components.
    For example, you can see some shared components by refer to here:
    http://support.microsoft.com/kb/2771441
    So it is hard for us to know what file may in use by the Setup file.
    Anyway I recommend you leave VS Setup from running and open Visual Studio 2013 when you finished the installation of Visual Studio 2012.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Why does Google Maps work so horribly on the iPhone??

    Does anybody else get extremely frustrated with Google maps? 9 times out of 10 it takes at least 30 seconds to fully load the map around my area. Showing traffic just doesn't function sometimes. It will stop loading when my map is still grey...the list of glitches goes on and on.
    I had an HTC Droid before my iPhone, and although my iPhone is infinitely better, Google Maps did work flawlessly on my Droid.
    I almost think that it doesn't work well because of the clash with Google and Apple softwares but I really don't know.
    Is this happening to anybody else?

    Bingo -- same finding as BikerBill7.
    For some reason, even though I do not set "country" in any of my Address Book entries on Mac, for some reason when I sync the iPhone Contacts inserts the "United States" into all my domestic contacts' addresses.  Even when I delete the address, re-enter in Address Book, and resync, it still adds the country. (Does not qualify as "syncing" in my opinion...)
    As a result, anytime I use my Contacts to obtain directions the Maps app stalls until I can interrupt and delete the "United States" from the address location bar and route again.

  • Why does Firefox 22 work so poorly with the latest version of Yahoo Email??

    I cannot open some folders, I cannot open some emails, so under Firefox 22 I find the newest version
    of Yahoo Email is crippled. Under Firefox 21, the same email functions quite a bit better.

    Please update to the current Firefox 22.0 release.
    *Help > About Firefox
    *https://support.mozilla.org/kb/update-firefox-latest-version.
    *https://support.mozilla.org/kb/Updating+Firefox
    The Firefox 21 version that you currently run is no longer supported with security updates.
    *It is important to update Firefox and add-ons to the latest version to get all security fixes.
    You can try basic steps like these in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and the cookies from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Why does Frame 10 print 3 copies of the same chapter when I print a book to pdf?

    I am printing a multi-chapter book. The table of contents generates perfectly but when I go to print the pdf of the book, Frame prints 3 duplicate copies of each chapter and TOC. Why is it doing this and how can I turn off this 'feature'? It is a pain to have to keep deleting the chapters from the pdf in Acrobat.
    Thanks

    > Maybe you have the print dialog set to print 3 copies.
    And that could have been set in the application printer dialogs, or in the operating system printer setup/preferences (or both, but then you'd get 9).
    It can also be set locally on some printers, but I suspect that's not what's happening here.
    Is everything in the book tripled-printed, or just some?
    Is it printed cover-toc-body 3 times, or cover-cover-cover, tocx3, bodyx3?
    Are other PDFs printing correctly to the same printer (using the same driver)?

  • I recently created a new iPhoto library, why does it now show 2 iPhoto libraries the same and 1 being my new one when I hold option and open iPhoto at the same time?

    I recently created a new iphoto library. It seems now that when I hold down the option key and open iphoto  I now have 2 iphoto libraries (both the same library) as well as my new library which is now my default as I intended but why would I now have 2 listed the same in this box? When I go to finder>pictures there is only the 2!! I hope I am making sense!

    Try the following to see if you can get rid of the ghost:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iPhoto folder (Snow Leopard and Earlier).
    or with Lion and Mt. Lion from the User/Library/Containers/com.apple.iPhoto/
    Data/Library/Caches/com.apple.iPhoto folder
    3 - launch iPhoto and try again.
    NOTE 1: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    NOTE 2:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.

  • Why does my brand new printer always print the same 1. thing that i printed before

    when i try to print something else it always prints the same thing i dont know why i deleted that old files but it still prints the old thing

    I would check to make sure the print queue is empty. I would also check the temp files on the computer (and anywhere else that a copy of it could exist depending on what operating system you are using) for that print item. 
    Also, make sure there is not a virus on the system. Those can do some weird things when certain conditions happen. Not likely just not something to overlook.
    007OHMSS
    I was a support engineer for HP.
    If the advice resolved the situation, please mark it as a solution. Thank you.

  • Prevent running the same program twice or more + some other..

    Hi All,
    I'm trying to figure out how to do the following
    1) How can I prevent a user from running the same program more than once.
    2)If a user try to shut down the computer while my program is running, I need to trap it down and save some data before terminating the program, how can I do it?
    Can any one help me???
    thanks a lot in advance!

    Don't [url http://forum.java.sun.com/thread.jspa?threadID=699067]cross post.
    Answers in the other post please.

  • Why does my iPad continuously closes from where I'm working and takes me to home screen?

    Why does my iPad continuously close from where I'm working and takes me to home screen?

    It might be out of memory. Close all apps you're not using using the toolbar that comes up when you double click on the home button. Press and hold any icon and then tap on the red minus (-) symbol of the apps you're not using.

  • Why does't Flashplayer work after I agreed to an update from an Adobe pop-up box prompt?

    I had problems last year when Flashplayer stopped working suddenly.  After months of seeking help, I received instructions that fixed the problem...until the other day.  A pop-up box from Adobe appeared indicating an update was available.  I agreed to installing the update and the Flashplayer has not worked since.  I referred to my notes from the "fix" last year and made one adjustment in the Active-X settings, but this did not help.  Flashplayer still does not work.  Help!  I just don't think I can go through this for several months again.

    Hi,
    I am going to try reorganizing my reply first and
    just forwarding to you before I try to recover a
    message.  I think the problem may be that I
    provided answers within your text instead of
    separately.  Your system may not like the format
    I tried.  So here goes....  I have pulled my
    answers out of your message and they appear in
    the order of your inquiries below.
    “Check the Windows system tray carefully to make
    certain no applications are still in memory which
    might possibly use Flash Player.” –a statement
    from the Adobe Un-install link article.  I don't
    know what “in memory” means.  The only things I
    have that may use Flashplayer that I know of is
    the Weather Bug.  Windows Mediaplayer is also
    listed in my programs, but I have never used it.
    Also, there is no mention of Norton here, but
    Norton Internet Security ’09 is what I have installed.
    1. No Firefox.  MSN Exlorer is listed among my
    Programs, but I have never used it.  It was
    likely installed by Dell when I purchased the computer.
    2. Norton Internet Security '09.  Bell Internet
    Security - Alert is listed in my programs (with
    options, including uninstall) but this is the first time I have noticed it.
    3. Norton Internet Security has a firewall with
    it that I understand is way better than Windows.
    4. There is a Google toolbar, Norton toolbar and
    a bunch of stuff listed in the Manage Add-ons
    like Skype, Adobe and Sun Java Console which I think are add-ons.
    Java Webstart is listed under Accessories in
    Programs.  In Programs is Adobe Distiller 6.0,
    Adobe Acrobat 6.0 Standard, Adobe (which is
    empty), Adobe.com and Adobe Reader 9.  I did not find DLM or GetPlus.
    I found no listing for Shockwave Flash
    Object.  You did not ask this and I don't mean to
    get ahead of you but in case there is relevance,
    I looked in Internet Options, Security, Custom
    and saw a number of reference to Active X and
    plug-ins, some of which are disabled; others enabled.
    From reading in your posts to mlmarg, I saw the
    instructions for finding the Flash folder and
    used them.  I used Explorer to access My
    Computer,, C Drive, Folder 1386, Folder System
    32.  There are 2 items in it from 2002 but not
    what I think you want.  The 2 are SMSS.EXE and
    NTDLL.DLL.  If this is not correct, I will need your instructions to locate it.
      I will ask because I don't always understand
    what you are asking of  me.  Thanks.
    >Date: Thu, 21 Jan 2010 14:23:36 -0500
    >To: [email protected]
    >Subject: Re: Flash Player Why does't
    >Flashplayer work after I agreed to an update from an Adobe pop-up box prompt?
    >
    >Hi,
    >My comments are within your text below.  Let me
    >know what I missed or misunderstood.

  • Why does Adobe sendnow work and the newest and greatest Adobe Send does not work?

    Why does Adobe sendnow work and the newest and greatest Adobe Send does not work? I wasted about 8 hours on trying to get Adobe Send to upload 269 files that amounted to 469MB. When it did not work I made a zip file and after a lot of wasted run time that did not work. The first situation gives little indication of when a file is loaded compared to Adobe SendNow. In both cases with Send it failed with a message like only the first 50 can be loaded. When I went and looked none of them had been loaded. With the zip file (I wanted to hide the individual files so they would not be counted) it appeared to work but very slowly and finally said it was done and I went and looked and it had done anything for oever 2 hours except a false "I'm runninng" indication.
    Thus, I took a chance with Adobe SendNow and it works great. It never gave me a limit on the amount of files nor on the size of the complete job. It shows me one file at a time when it has finished with the file uploading it. SendNow has never given me any problems.
    Why woiuld you want to change the program from SendNow to Send without the newest program being the best, fastest, user friendly program of the two? It just doesn't make sense to me. I suggest that Adobe keep SendNow working until Send is fixed. I would also suggest that SendNow and how it looks be kept, called Send, then modify Send one thing at a time until you get it to the point you need it to be for Acrobat. I have heard nothing good and now I have experienced it that Send is a piece of junk. I wasted most of my work day on giving Adobe the benefit of the doubt to find out I made a very bad decision to trust Adobe to make good decisions on the transfer of a function to another place .... both Adobe's responsibility.without making it painless for your customers that totally rely on you. Don't throw away customer confidence as it is very hard to get it back.

    Funny how you answer to "troll". (What's your handle on AT&T forums?)
    Yep! Verizon living up to it's contractual obligations by not releasing updates. Caveat emptor!
    I think there are some reasonable expectations here to keep customer's happy. When one carrier offers upgrades there is an expectation the same will happen across all the carriers. We have seen that except Big Red.
    Verizon could have said the update is in MS court months ago and stilled the voice of the disgruntled, or at least redirected it, but instead chose to be silent. Not for market share but for partial blame I think.
    We will have to agree to disagree since you only see Terms & Conditions and I, see customer satisfaction.

  • HT204291 Airplay intermittent problem, why does not airplay work well anylonger?

    Airplay intermittent problem, why does not airplay work well anylonger. Suddenly it drops out. Now this function has gone from great to ****.
    Trying to view streamed content from the ipad to the Apple TV? Nah forget about it. Sooo dissapointing.

    Restart your wifi router

  • Why does my mouse pointer change from a hand to a downward facing arrow sometimes?

    why does my mouse pointer change from a hand to a downward facing arrow sometimes?

    the-edmeister, you are a genious. I went to "view" then "toolbars" and de-selected "yahoo toolbar" and then moved the curser over my firefox page and it now works completely including the problem area (the top 3 cm of each screen). Thank you, thank you, thank you, thank you, thank you, thank you. You have no idea how good I feel know on this otherwise cold, windy and rainy day.

  • HT1338 Why does mountain lion make my computer run slow and my Safari too?

    why does Mountain Lion make my computer run slow and my Safari too? Please help!

    The problem is probably not mountain lion. It works just fine on my computer. And a few million others.
    If your computer is having problems, you can try to fix it with some simple troubleshooting maneuvers.
    Take a look at:
    Mac OS X BASIC TROUBLESHOOTING & MAINTENANCE Tips Mountain Lion 10.8 Lion 10.7 Snow Leopard 10.6 10.5 Tiger 10.4 Why How To Tutorials

Maybe you are looking for

  • Portege 244OCT - Is it possible to boot from a external CD-ROOM

    Hi, I've just got an old Toshiba Portege 344OCT laptop with an HD of 6 GB and with an intel Pentium III processor 500 MHz and 128 MB RAM. At the moment i have it under Windows XP Home Edition. I would like to revert it to Windows 98SE but the compute

  • Adobe Video Tutorials

    Hello, I have an unusual question. Adobe's video tutorials are always brilliantly made and very helpful. My question is, do you make the videos internally or do you outsource them? If you outsource, can you please name the agency? We are looking for

  • Safari - POSIX Error

    I have just recently encounterd the following error in Safari which prevent me from opening any website in Safari 3.0.4: POSIX error: Cannot allocate memory² (NSPOSIXErrorDomain:12) I use Entourage for email, and I am able to use an older version of

  • Restore applications and files through SL TM vs. Leopard TM

    I've been reading a lot about all the different options for installing SL. It seems to me like the way I'd like to go is be doing a clean install. What concerns me about the clean install is, the reinstallation of applications. The main applications

  • Help!! ps cs hanging a lot -- esp in browser

    Hi All, I am running photoshop cs on an imac g5 osx10.4.11.... my daughter managed to switch of my power twice today, and now photoshop is hanging.... I have reset pram and smu and repaired permissions... when I started photoshop after the second swi