![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| run script through terminal | sadiquep | Linux | 5 | 09-24-2008 08:44 AM |
| Running a script without a terminal session | jjinno | Shell Programming and Scripting | 3 | 10-03-2007 02:50 AM |
| Script to launch terminal window? | omerta | SUN Solaris | 5 | 06-30-2005 06:48 PM |
| Run the start script from the terminal? Newbie Time! | waking_bear | UNIX for Dummies Questions & Answers | 4 | 03-04-2004 07:09 PM |
| connecting to unix through hyper terminal - as a dumb terminal | michelle | UNIX for Advanced & Expert Users | 2 | 11-05-2001 03:32 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I'd like to write a script that will run when I log into OS X, which will do the following:
1) Launch Terminal 2) Immediately close the window that Terminal creates when it opens. 3) Preferably, keep Terminal hidden while all this is happening, so all I see is the Terminal icon bouncing in the dock as the program launches. Any advice appreciated ![]() PS: I'd prefer the script to be a .sh or a .c file (to compile), as those are the only two languages I have some experience in at the moment. Thanks. |
|
||||
|
It would be helpful to know why this operation is important because there may be a better way to accomplish the "why" than you might realize.
I can't image a use for having Terminal launch at startup without a window. Not that there isn't one, but I just can't imagine it. AppleScript can be used to hide a window, but the application first has to create the window (which displays on creation), then hide it immediately. The window is thus only visible for a split second. You can send applescript code from shell scripts using the osascript command (man osascript). You can examine Terminal's applescript functionality from within Script Editor.app by selecting "Open Dictionary..." from the Script Editor "File" menu, then navigating to Terminal.app. Otherwise, I don't know if this is possible from the command line. ![]() |
|
||||
|
I dont have a mac infront of me so I cant test but..
#!/bin/bash open /Applications/Terminal.app & maybe that will work, I dont know.. you can save it as a .sh file, then run chmod +x on it (I'm not sure that is even necessary, but shouldnt hurt).. then you can add it as a launchd item which I am not able to explain right now.. hopefully this info will help somewhat. OR... just go to system prefs/accounts and add Terminal.app to your login items and check the hide box.. probably the easiest way. Last edited by glev2005; 12-10-2008 at 06:52 PM.. |
![]() |
| Bookmarks |
| Tags |
| linux, linux commands, shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|