Sponsored Content
Full Discussion: Terminal script
Operating Systems OS X (Apple) Terminal script Post 302088128 by [MA]Flying_Meat on Friday 8th of September 2006 05:26:38 PM
Old 09-08-2006
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.
Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

connecting to unix through hyper terminal - as a dumb terminal

I just changed from windows NT to XP and I am no longer able to connect to my unix system. I used to use hyper terminal -- which acts as dumb terminal to my main frame unix system. I think one of the options used to be "direct to comX". This option isn't listed now. I use a serial port and the... (2 Replies)
Discussion started by: michelle
2 Replies

2. UNIX for Advanced & Expert Users

Pseudo-terminal will not be allocated because stdin is not a terminal.

I am trying to automate a SSH login using Keys using the following command ssh -i id_rsa usernamw@ipaddr. I am successful in doing this and i am getting the Warning Screen and I logon successfully. but when I am executing the command tail -1cf put.dat | ssh -i id_rsa username@ipaddr > get.dat ... (1 Reply)
Discussion started by: Shivdatta
1 Replies

3. Linux

run script through terminal

for all friends i am using linux enterprise 4. i installed oracle 10g in user name oracle.at the end of install i got a pop up window saying that u should run the following scripts(root.sh,orainstRoot.sh) in terminal from root account(cui) without log out oracle account . how i can run these... (5 Replies)
Discussion started by: sadiquep
5 Replies

4. Shell Programming and Scripting

running terminal with script

suppose we have a file ab 81 and another file exec < $1 while read line do ssh root@172.16.1.$line done while running the command sh file.sh ab output display as shown Pseudo-terminal will not be allocated because stdin is not a terminal. root@172.16.1.81's password: after... (3 Replies)
Discussion started by: cdfd123
3 Replies

5. OS X (Apple)

terminal script stops after script command :(.

Hello, i am trying to write a script for terminal for my mac that i may drag into the terminal and will excute the following command: script -akq Desktop/TerminalLogin/Cisco1Bob.txt telnet x.x.x.x the problem is that when i drag the text file to the terminal window the script stops after... (6 Replies)
Discussion started by: drdread
6 Replies

6. UNIX for Dummies Questions & Answers

Gnuplot wxt terminal vs x11 terminal

Hi, I installed ubuntu recently on my pc. And I installed gnuplot as well. When I first started working with gnuplot it was working . I did a plot and when I wanted to fit my data something happened and not the default terminal of gnuplot is xwt! I changed it to: set terminal x11, but it... (0 Replies)
Discussion started by: cosmologist
0 Replies

7. OS X (Apple)

Terminal Command into script

Hi All I have this script that checks to see if ntp is enabled on a machine launchctl load -w /System/Library/LaunchDaemons/org.ntp.ntpd.plist It retuns org.ntp.ntpd: Already loaded if it is loaded, is there a way to script it so that if it is loaded it does not say anything but... (2 Replies)
Discussion started by: ab52
2 Replies

8. Shell Programming and Scripting

Run script in new terminal

Hi Guys, I have a script that runs certain simulations in batch mode. I need to schedule some simulations to run over night. For each simulation to complete it should be run in separate terminal. My script is as follows sh run_test.sh <arg1> <arg2> <arg3> ... I need to launch this... (5 Replies)
Discussion started by: aelhosiny
5 Replies

9. Shell Programming and Scripting

Cannot get terminal application to launch with a graphical launcher when successful in terminal

I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies

10. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies
OSASCRIPT(1)						    BSD General Commands Manual 					      OSASCRIPT(1)

NAME
osascript -- execute OSA scripts (AppleScript, JavaScript, etc.) SYNOPSIS
osascript [-l language] [-i] [-s flags] [-e statement | programfile] [argument ...] DESCRIPTION
osascript executes the given OSA script, which may be plain text or a compiled script (.scpt) created by Script Editor or osacompile(1). By default, osascript treats plain text as AppleScript, but you can change this using the -l option. To get a list of the OSA languages installed on your system, use osalang(1). osascript will look for the script in one of the following three places: 1. Specified line by line using -e switches on the command line. 2. Contained in the file specified by the first filename on the command line. This file may be plain text or a compiled script. 3. Passed in using standard input. This works only if there are no filename arguments; to pass arguments to a STDIN-read script, you must explicitly specify ``-'' for the script name. Any arguments following the script will be passed as a list of strings to the direct parameter of the ``run'' handler. For example, in AppleScript: a.scpt: on run argv return "hello, " & item 1 of argv & "." end run % osascript a.scpt world hello, world. The options are as follows: -e statement Enter one line of a script. If -e is given, osascript will not look for a filename in the argument list. Multiple -e options may be given to build up a multi-line script. Because most scripts use characters that are special to many shell programs (for example, AppleScript uses single and double quote marks, ``('', ``)'', and ``*''), the statement will have to be correctly quoted and escaped to get it past the shell intact. -i Interactive mode: osascript will prompt for one line at a time, and print the result, if applicable, after each line. Any script sup- plied as a command argument using -e or programfile will be loaded, but not executed, before starting the interactive prompt. -l language Override the language for any plain text files. Normally, plain text files are compiled as AppleScript. -s flags Modify the output style. The flags argument is a string consisting of any of the modifier characters e, h, o, and s. Multiple modi- fiers can be concatenated in the same string, and multiple -s options can be specified. The modifiers come in exclusive pairs; if con- flicting modifiers are specified, the last one takes precedence. The meanings of the modifier characters are as follows: h Print values in human-readable form (default). s Print values in recompilable source form. osascript normally prints its results in human-readable form: strings do not have quotes around them, characters are not escaped, braces for lists and records are omitted, etc. This is generally more useful, but can introduce ambiguities. For example, the lists '{"foo", "bar"}' and '{{"foo", {"bar"}}}' would both be displayed as 'foo, bar'. To see the results in an unambiguous form that could be recompiled into the same value, use the s modifier. e Print script errors to stderr (default). o Print script errors to stdout. osascript normally prints script errors to stderr, so downstream clients only see valid results. When running automated tests, how- ever, using the o modifier lets you distinguish script errors, which you care about matching, from other diagnostic output, which you don't. SEE ALSO
osacompile(1), osalang(1), AppleScript Language Guide HISTORY
osascript in Mac OS X 10.0 would translate ' ' characters in the output to ' ' and provided c and r modifiers for the -s option to change this. osascript now always leaves the output alone; pipe through tr(1) if necessary. Prior to Mac OS X 10.4, osascript did not allow passing arguments to the script. Mac OS X April 24, 2014 Mac OS X
All times are GMT -4. The time now is 04:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy