Terminal freaked out by '&' symbol?

Discussion in 'macOS' started by Denarius, Oct 17, 2008.

  1. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #1
    I just compiled mysql and discovered that I would have to type
    Code:
    shell:~ sudo mysqld_safe --user=mysql &
    Apparently the & symbol is there to make it run in the background, but I'm finding it's having an odd effect on the terminal window and seems to cause sudo to jump over the password prompt.

    Code:
    Last login: Fri Oct 17 10:32:30 on ttys000
    PennyMBP:~ adam$ sudo mysqld_safe --user=mysql &
    [1] 185
    PennyMBP:~ adam$ Password:
    Type the password at the prompt and it's not actually receiving a password.

    Can anyone repeat this behaviour? Do you think it's a bug in terminal or have any other explanation?

    Thanks folks.
     
  2. misterredman macrumors 6502a

    misterredman

    Joined:
    Oct 3, 2007
    #2
  3. Denarius thread starter macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #3
    Thanks for pointing that out to me. Does seem a very messy bit of behaviour, but I reckon I can work with that. :)
     
  4. itickings macrumors 6502a

    itickings

    Joined:
    Apr 14, 2007
    #4
    Agreed, not a bug.

    If it is in the background, it is in the background and not interactive anymore.

    One option may be to start the program in the foreground as normal, enter the password, then hitting CTRL+Z an enter the command bg.

    Code:
    sudo mysqld_safe --user=mysql
    [password]
    [CTRL-Z]
    bg
     
  5. Denarius thread starter macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #5
    I didn't know about Ctrl+Z, thank you for the tip!

    While scouting around on this problem, I found a nice launchd approach on HiveLogic that works very nicely indeed if you want it to start and stop on startup and shutdown and lets you launch/kill manually through launchctl.
     

Share This Page