Preparing a Mac pathname for shell execution from Perl

I'm coding in Perl. @pathnames is an array of absolute Mac pathnames; as such, they may contain blanks. I want to append all of these pathnames to the name of a shell script, and have the shell execute it.
For example, suppose
@pathnames = ("/Shared/John Doe/able.txt", "/Shared/John Doe/baker.txt");
and suppose the script is 'fubar'. I want the shell to receive:
fubar /Shared/John Doe/able.txt /Shared/John Doe/baker.txt
Although I suppose it would be just as good to have:
fubar '/Shared/John Doe/able.txt' '/Shared/John Doe/baker.txt'
What steps are necessary, in Perl, to accomplish this? I expect the final step would look something like:
qx($myCompleteFubarCommand);
I've messed around with quotemeta, Q, single quotes, double quotes, etc. till I must go mad.
Anybody?
Thanks!
Chap

You could try to substitute the blanks with "\blank", the first thing which came to my mind is this
#!/usr/bin/env perl
$MYPATH="/Shared/John Doe/my important docs/whatever.txt";
$MYPATH=~s/ /\ /g;
print $MYPATH;
Remove the underscores "_" before using the code, I had to include them to stop the editor from messing around with the code.
Erik
Message was edited by: Erik Keller (Editor messed up the code)

Similar Messages

  • Looking for job execution from backend

    All,
    I need a bit a help. OEM apprently doesn't keep snapshots after the database is shutdown and restarted. What I'm looking for is a way to view what jobs are schedule and had run within the last twelve hours from SQL*Plus.
    Any ideas?
    Thanks,
    Bobby

    As the sysman user...
    SELECT job_owner
    ,job_name
    ,target_name
    ,target_type
    ,job_type
    ,start_time
    ,end_time
    ,status
    FROM sysman.mgmt$job_execution_history
    WHERE start_time BETWEEN (SELECT SYSDATE - 12/24
    FROM dual)
    AND SYSDATE /* jobs executed in the last 12 hours */
    OR start_time > SYSDATE /* OR jobs scheduled in the future */
    ORDER BY start_time DESC;

  • I rec'd a Mac Pro for my school from the "Computers for Learning" program. The hard drive had been removed. I ordered a new hard drive (1TB) and cannot get OSX Mavericks to load. I also cannot partion the disk on disk utility from my Macbook Pro.

    I received an Mac Pro (2007). It was shipped without a hard drive. I ordered a hard drive, 1TB Barracuda Sata but cannot get it to partition. I have OSX Mavericks on a USB drive. Help?

    Notr I edited my previous reply to say you also have to upgrade the video card
    https://discussions.apple.com/thread/5827271
    https://discussions.apple.com/docs/DOC-6592
    "OS X Mavericks on an Original Mac Pro", FairerPlatform, October 14, 2013
    Jump up^ "Mac Pro review, 9 out of 10". Ars Technica.

  • How do I clean off mac mini for resale

    I recently bought an iMac and am going to sell my Mac mini. The only thing on there are my pics and iTunes. Is there anything special I need to do when it comes to deleting those items before getting rid of the computer?
    thanks.

    You can actually just shut down your system safely when you get to that point. Hold down the power button for 3-5 seconds and the system will power down/shut off.
    When the new owner boots the machine it'll proceed directly to the system setup as if the machine was turned on for the first time. Presuming you performed an erase and install.
    We all at some point upgrade from our present Macs to newer state of the art Macs. For example upgrading from a 17" PowerBook G4 to a 17" MacBook Pro.
    Macs have a high resale value and people are always looking for a second system, a system for their children, or looking for a bargain. Remember to include the restore disks, user manuals, accessories, etc., that came with your system when you first bought it.
    One of the things that make a Mac special is the high resale value. It is also how many new users, "switchers" experience their first Mac. 9 out of 10 those buyers will purchase a new Mac down the road obviously because of the Mac itself but also because of their buying experience.
    They always remember their first Mac and their actual buying experience, so make it as if you were buying the system. What would you consider when buying from a complete stranger and what would you want and how would you want to be treated?
    Good Luck!

  • Install Mac Drivers for Boot Camp without right Leopard install disk

    This is my first post so please excuse my lack of knowledge. I am currently in Dubai for a week of work and was having a problem with my Windows OS. I removed the partition and reinstalled Windows XP with the Windows disk I brought with me. When I went to install the Mac drivers from the Leopard Install disk 10.5.0 that I had also brought with me, I noticed it was the Leopard disk that I bought last year to upgrade my prior MBP from Tiger and not the Leopard 10.5.2 disk that came with my current MBP that I bought last month. I tried it anyway and as it was loading it would always crash in the same place- as it was loading the Broadcom driver. It was the blue display of death. Is there anyway that I can find Mac Drivers for a MBP from a 10.5.2 disk and extract them without actually having the right install disk which is back at my home in Los Angeles? I really need help! Thanks and sorry for the long post.

    You could use Disk Utility to "Restore" the installation DVD to a USB Flash Drive. Boot from it to do the work. Your optical drive could be having "issues", or the DVD could be hard to read for some reason. You should be able to hold down the Option key during boot to choose to boot from the flash drive.
    If you can't do the work from your Mac because of a hardware problem then you could try a different machine to make the flash drive.
    If a different machine can't make the flash drive, then the media is bad.

  • Should I necessarily use an external hard "for mac" to get a backup from my macbook?

    I want to get a backup from my macbook pro using the time machine. Should I necessarily use an external hard "for mac" to get a backup from my macbook? Because I have an external hard, but its not for mac. Is there any way I can use this one?

    You can use the external drive you want with your Mac. However, the "for Mac" external drives come prepared to connect them and start using them, and probably you will have to do some additional steps with your external drive.
    First, you will have to format the external drive with "Mac OS Extended (Journaled)", the only filesystem compatible with OS X. If you have got files on the external drive, you have to copy them to your Mac before erasing the drive. Then, follow these steps to format the external drive with "Mac OS Extended (Journaled)" > http://pondini.org/TM/5.html
    Then, to use Time Machine, open System Preferences > Time Machine > Select Disk, and choose your external drive, so your Mac will start making backups to your external drive

  • What is the pathname for mail that I can get to from a terminal window

    What is the pathname for mail that will allow me to get to mail from a terminal window?
    [ iMac 27-inch;  Mac OS X version 10.7.5 ]

    Your best bet would be to take the drive to the oldest/compatible with that drive Windows PC and grab the files off, right click and format it exFAT (XP users can download exFAT from Microsoft) and then put the files back on.
    Mac's can read and write all Windows files formats except write to NTFS (and in some cases not read) so if you can change the format of the drive to exFAT (all data has to be remove first) then you will have a drive that doesn't require paid third party NTFS software (a license fee goes to Microsoft) for updates.
    Also it's one less hassle to deal with too.
    .Drives, partitions, formatting w/Mac's + PC's

  • How to partition my drive for  Mac and XP use?  from a novice

    I would like to use my MacBook Pro for both Mac ad PC programs (Office and others) and hear that I can partition the drive.  How is the best way to do that?  Also I have an external Seagate FreeAgent GoFlex external drive to set up that supposedly can back up both Mac and PC without formatting each time.  Do I have to partition the drive first?  Do I use Time Machine?

    Is it your intent to run Windows programs on your computer?  If so then this is more than simply a partitioning exercise.
    In order to use an external drive on both Macs and PCs there are two options.  Option One is to partition and format the drive MBP and FAT32, respectively.  OS X can read/write a FAT32 formatted drive.  However, due to filesystem differences some features of the OS X filesystem are not supported by FAT32, so FAT32 is not the best choice for transferring OS X documents, but would be fine for transferring Windows documents.
    Option Two is to partition the drive using GUID then creating two partitions.  One partition is formatted Mac OS Extended, Journaled and the other partition is formatted FAT32.  Each partition can be used for the data from the appropriate platform.
    TM is not a file transfer program, cannot be used for Windows documents, and does not work on Windows.
    If you wish to run Windows on your Mac then see the following:
    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
    1. Install the Apple Boot Camp software.  Purchase Windows XP w/Service Pak2, Vista, or Windows 7.  Follow instructions in the Boot Camp documentation on installation of Boot Camp, creating Driver CD, and installing Windows.  Boot Camp enables you to boot the computer into OS X or Windows.
    2. Parallels Desktop for Mac and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  Parallels is software virtualization that enables running Windows concurrently with OS X.
    3. VM Fusionand Windows XP, Vista Business, Vista Ultimate, or Windows 7.  VM Fusion is software virtualization that enables running Windows concurrently with OS X.
    4. CrossOver which enables running many Windows applications without having to install Windows.  The Windows applications can run concurrently with OS X.
    5. VirtualBox is a new Open Source freeware virtual machine such as VM Fusion and Parallels that was developed by Solaris.  It is not as fully developed for the Mac as Parallels and VM Fusion.
    Note that Parallels and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system.
    See MacTech.com's Virtualization Benchmarking for comparisons of Boot Camp, Parallels, and VM Fusion. Boot Camp is only available with Leopard or Snow Leopard. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows. You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

  • What is the direct connect method for transfering photos from my macbook pro to my iphone without using iTunes syncronization? (iow: a simple photo copy from mac to iphone?)

    I feel like I should know the answer to this. I can't believe it is a hard question.
    What is the direct connect method for transfering photos from my macbook pro to my iphone without using iTunes syncronization? (iow: a simple photo copy from mac to iphone?)
    Easy? Right?
    Just plug my iphone in to a mac and copy a photo from the mac to my iphone.
    I don't have internet access - I can't email it, or mobileme it, or dropbox it.

    iTunes. Other than that there is no direct method. However, do try the iPhone forums.

  • Not SURE HOW TO TRANSFER PHOTOS  FROM A "MAC CD" FOR USE A PC

    I didn't expect a problem, but have run into one this weekend.
    Looking thru old photos, I came across a photo disk from Ritz Camera containing pix from 2006. Wanted to pass along the pix (along with other photos and documents) to a friend who has a PC.
    After burning all the data onto a fresh CD, I tested the disk on a PC and found all the other files could be opened except for the items from the original Ritz CD.
    Those items included three separate folders, nested within a single fourth one.
    The folders were labeled "Ritz Documentation" . . . "Preview" and "Pictures".
    The last two appeared to contain identical JPG items, but I left them all intact.
    I'm not particularly PC savvy, and the owner of the PC computer has departed, so I had to wing it on my own. The only thing close to a photo manipulation application I could find on the PC was Picassa, which located the disk and files in the CD drive and was able to read the three other individual items, but could only recognize the three Ritz files. When I clicked on them it said they were "invalid" documents.
    Any idea on what I'm doing wrong?
    I know the files were readable by the owner's previous PC in 2004, so assumed they would be now, as well. I also still can see clearly the copies I transfered to my Mac and did nothing to them, except drag the entire original folder from my Mac to the new CD.
    If the files can't be copied this way, would it make any more sense to transfer all the files directly from the Ritz CD to the PC and add the other 3 files from the CD I created . . . then transfer them all to a new CD for burning?
    Sounds convoluted and time consuming, but I need to complete this project today, so am ready to try anything.
    Any insight or suggestions?
    Thanks in advance.

    Sory, I can't find the name of the MacUser who steered me onto the right path, but do think I remember thanking him via e-mail.
    If I'm mistaken, thanks a bunch. I finally finished transferring all the photos onto a CD. Actually completed one project , which I was able to test on a PC.
    Have run into a second, smaller one on the current project, which I I think I probably should post separately.

  • I have a mac mini server which I want to set up for remote access from windows and mac pcs.  How do I do this.  I can access it form my home network OK

    I have a mac mini server which I want to set up for remote access from windows and mac pcs.  How do I do this.  I can access it form my home network OK

    Posted in error.

  • Will Mac allow you to boot from an external drive...specifically for windows programs?

    Will a new Mac allow you to boot from an external drive...specifically for windows programs?

    ps...I've read the threads on Bootcamp.

  • Acrobat Pro 9 for mac won't launch, reloaded from disk when hard drive needed to be replace. It's in applications folder but there is an X on the Acrobat Reinstall icon. What should I do.

    Acrobat Pro 9 for mac won't launch, reloaded from disk when hard drive needed to be replace. It's in applications folder but there is an X on the Acrobat Reinstall icon. What should I do.

    Hi Janice,
    What version of Mac OS are you using?
    Adobe does not recommend migrating the software from one disk to the other.
    Please run the setup file for Acrobat and reinstall the software. You might want to delete the existing version of Acrobat installed before reinstalling it.
    Regards,
    Rave

  • I have recently bought a mac. how do i request a platform swap for my cs5 from pc to mac?

    i have recently bought a mac. how do i request a platform swap for my cs5 from pc to mac?

    You can only swap current versions. you wil lhave to upgrade to CS6 at least and make the switch:
    Order an Adobe product platform swap or language swap
    Mylenium

  • HT1657 Can I transfer a rental from ipad to mac computer for downloading?

    Can I tranfer a movie rental from ipad to mac computer for downloading?

    If you rented it on a computer, use the Transfer Purchases function in iTunes.
    If you rented it on the iPad, no.
    (95608)

Maybe you are looking for

  • Apple Mail Rules dont apply when mail is READ on other devices!

    Hi, I use IMAP settings on Apple Mail (v4.5) and also check my emails on the iPhone (iPhone also set up with IMAP). However if i have read an email on the iPhone then when i switch my computer on the incoming Apple Mail Rule that applies to that send

  • Open items and how they return to the dock

    Recently I have noticed that when I click on something and it returns to the dock, it does this funny special effect. This is new to me and I have no idea how to stop it from doing it just return to the old fashioned way it just snapped to the dock.

  • How to send a String to a Servlet using a HTTP POST

    Well, I have designed a servlet that receives a HTTP POST, I was testing it using an HTML form to send (using POST) information, now, I have coded a Java App to send it a string, I don't know how to make the servlet recognize that info so it can make

  • Copy after to before for multiple photos?

    Frequently I forget to update the 'after' adjustments to the 'before' adjustments for photos I visit. Is there a way to perform 'copy after settings to before settings' for selected photos. It would save me having to manually visit each one by one. M

  • VBA needed that utilizes replace function

    Hi,  I have this simple VBA that allows me to select my range and put a symbol in front of the data: Sub AddtoFront() Dim Rng As Range For Each Rng In Selection Rng.Value = "~" & Rng.Value Next Rng End Sub However, I am looking to expand this in a bi