CyX SenZe

Q: Single backslash in string possible?

Screen Shot 2015-06-12 at 1.27.25 AM.png

This is basically what I'm trying to do. Creating a bootdisk for Yosemite. This is an extract of the full script. I basically will take the runIt variable and use it like so:

 

do shell script runIt

 

formatname would be the name of the disk I select, from a selection of thumb drives available.

No matter what I try I can't get runIt to set single backslashes for the areas with spaces between. I tried double backslash, ascii character, concatenation and nothing has worked for me yet. The result is always double backslashes. I tried up to 4 consecutive slashes already. Is this even possible?

MacBook Pro, OS X Yosemite (10.10.3)

Posted on Jun 11, 2015 10:41 PM

Close

Q: Single backslash in string possible?

  • All replies
  • Helpful answers

  • by Kappy,Helpful

    Kappy Kappy Jun 11, 2015 10:44 PM in response to CyX SenZe
    Level 10 (270,334 points)
    Desktops
    Jun 11, 2015 10:44 PM in response to CyX SenZe

    Make your own Yosemite flash drive installer using the Yosemite tool:

     

    You can create a Yosemite flash drive installer via the Terminal. Yosemite has its own built-in installer maker you use via the Terminal:

     

    You will need a freshly partitioned and formatted USB flash drive with at least 8GBs. Leave the name of the flash drive at the system default, "Untitled." Do not change this name. Wait for the process to complete which will take quite some time.

     

    Open the Terminal in the Utilities folder. Copy and paste the following command line in its entirety into the Terminal window.

     

    sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app

     

    Press RETURN, enter admin password (will not echo to the window) then press RETURN again.

     

    You need to have the installer in your Applications folder or change the paths in the above command line.

     

    Create a bootable installer for OS X Mavericks or Yosemite - Apple Support

  • by Niel,Solvedanswer

    Niel Niel Jun 11, 2015 10:46 PM in response to CyX SenZe
    Level 10 (311,961 points)
    Jun 11, 2015 10:46 PM in response to CyX SenZe

    You're entering the backslashes properly in your current script; the second backslash in each pair is used to escape the first and won't be passed to the shell.

     

    For example, running:

     

    do shell script "ls /Volumes/Macintosh\\ HD/"

     

    will be passed to the shell as:

     

    ls /Volumes/Macintosh\ HD/

     

    (128653)

  • by CyX SenZe,

    CyX SenZe CyX SenZe Jun 11, 2015 11:07 PM in response to Niel
    Level 1 (0 points)
    Jun 11, 2015 11:07 PM in response to Niel

    Screen Shot 2015-06-12 at 1.51.45 AM.png

    So if I did this correctly, what is no tty present and no askpass program specified?

    ... update. I added with admin privileges and it doesnt give me the tty present anymore but it doesn't actually initiate the sequence

     

    with and without quoted form..

     

    WITH

    Screen Shot 2015-06-12 at 2.05.36 AM.png

    WITHOUT

    Screen Shot 2015-06-12 at 2.04.49 AM.png

  • by CyX SenZe,

    CyX SenZe CyX SenZe Jun 11, 2015 11:10 PM in response to Niel
    Level 1 (0 points)
    Jun 11, 2015 11:10 PM in response to Niel

    Clicked answered my question by accident. The sudo command never actually activates and starts the process of creating the bootable media. I included screenshots above.

  • by CyX SenZe,

    CyX SenZe CyX SenZe Jun 11, 2015 11:30 PM in response to CyX SenZe
    Level 1 (0 points)
    Jun 11, 2015 11:30 PM in response to CyX SenZe

    So now just to figure out why it isn't actually initiating the installation of the bootable media.

  • by Niel,

    Niel Niel Jun 12, 2015 6:39 AM in response to CyX SenZe
    Level 10 (311,961 points)
    Jun 12, 2015 6:39 AM in response to CyX SenZe

    Remove the 'sudo ' from the front of the script; the 'with administrator privileges' text handles that itself.

     

    (128654)