Results 1 to 5 of 5
  1. #1


    Member Since
    May 18, 2011
    Posts
    2
    Open a url in mac with blocking terminal
    Hi,

    I am trying to open a url in Safari through terminal in my MAC machine. I am using following command:

    open -a /Applications/Safari.app Google

    As soon as hit enter, this url opens in Safari but terminal doesn't block i.e. it comes out.

    Then, i tried:
    open -a /Applications/Safari.app/Contents/MacOS/Safari Google

    same thing happens: As soon as hit enter, this url opens in Safari but terminal doesn't block i.e. it comes out.

    Then i tried:
    /Applications/Safari.app/Contents/MacOs/Safari Google

    in this case, as soon as i hit enter, it blocks the terminal but in browser (Safari) it opens: file:///Users/Administrator/http:/google.com

    How i open one url using terminal such that it opens that url properly in Safari and it blocks terminal also until i close the browser (in that case, it should come out).

  2. #2


    Member Since
    May 18, 2011
    Posts
    2
    Open a url in mac with blocking terminal
    Hi,

    I am trying to open a url in Safari through terminal in my MAC machine. I am using following command:

    open -a /Applications/Safari.app Google

    As soon as hit enter, this url opens in Safari but terminal doesn't block i.e. it comes out.

    Then, i tried:
    open -a /Applications/Safari.app/Contents/MacOS/Safari Google

    same thing happens: As soon as hit enter, this url opens in Safari but terminal doesn't block i.e. it comes out.

    Then i tried:
    /Applications/Safari.app/Contents/MacOs/Safari Google

    in this case, as soon as i hit enter, it blocks the terminal but in browser (Safari) it opens: file:///Users/Administrator/http:/google.com

    How i open one url using terminal such that it opens that url properly in Safari and it blocks terminal also until i close the browser (in that case, it should come out).

  3. #3

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Merged threads. Please do no crosspost (post message in more than one forum).

    Can you clarify what you mean by "terminal doesn't block" and "it comes out"? From what I see, you've pretty much exhausted your options there.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  4. #4

    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,866
    Specs:
    Way... way too many specs to list.
    Code:
    mikeMbp:~ mike$ open -a /Applications/Safari.app "http://www.google.com"
    mikeMbp:~ mike$  echo $?
    0
    works fine for me. Terminal's still available too, which makes sense. The command's been successfully completed, which is why it returns to a prompt (so it doesn't come out, it's done processing). Why are you looking to hang the stdin is probably a better question at this point.
    mike
    This machine kills fascists
    Got # ? phear the command line!

  5. #5

    EvenStranger's Avatar
    Member Since
    Dec 09, 2010
    Location
    Virginia
    Posts
    844
    Specs:
    Currently 13" Late 2010 MBA, 4GB/128GB; Early 2011 13" MBP, dual core i7 2.7ghz, 4gb ram, 500gb hd
    This isn't going to be solved by a simple single line command. Open is doing exactly what it's supposed to - it's a finite command, and once the app is open, it's done and returns the user to the command prompt. The other option, calling the app directly, attempts to point the user to a local file on the computer. Odds are this is going to require some combination of shell and AppleScript to call the proper URL. Maybe that's the clue - create the AppleScript to open the URL, and then call it directly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dock is blocking open/close buttons
    By LDubya in forum OS X - Operating System
    Replies: 7
    Last Post: 05-01-2013, 08:51 PM
  2. Open Internet groups to file FCC complaint over AT&T's FaceTime blocking
    By OneMoreThing... in forum Apple Rumors and Reports
    Replies: 0
    Last Post: 09-18-2012, 08:20 PM
  3. Mail Cant open URL (links)
    By golicoke in forum OS X - Operating System
    Replies: 4
    Last Post: 09-17-2012, 08:29 PM
  4. blocking websites with terminal
    By garrettdini in forum Web Design and Hosting
    Replies: 0
    Last Post: 09-05-2010, 02:27 PM
  5. Getting round URL blocking on our network
    By batfastad in forum Schweb's Lounge
    Replies: 0
    Last Post: 07-05-2006, 05:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •