Sponsored Content
Top Forums Shell Programming and Scripting Cannot get terminal application to launch with a graphical launcher when successful in terminal Post 302966628 by Don Cragun on Monday 15th of February 2016 12:04:29 AM
Old 02-15-2016
Whatever shell is running your script via the "run in terminal" command is a shell that doesn't know about the recent bash and ksh [[ expression ]] test syntax.

If you convert all occurrences of expressions of the form:
Code:
[[ "$command" == S ]] || [[ "$command" == s ]]

to:
Code:
[ "$command" = S ] || [ "$command" = s ]

or convert the entire if ... elif ... fi tree to a case statement:
Code:
case "$command" in
([Ss]) echo; echo $(iwlist scan | grep -E "Quality|Signal level|Encryption key|ESSID";;
([Cc][Tt][Nn]) echo; echo "SSID:"; echo; read said; echo; echo "Key:"; echo; read passwd; sudo nmcli d wifi connect "$ssid" password "$passwd" iface wlan0; echo;;
...
esac

then most shells based on Bourne shell syntax should be able to run your script.

However, note that naming a function test (overriding a utility normally found in /bin and the built-in found in most shells that accept Bourne shell syntax) is a VERY BAD idea.

Unless all of the utilities invoked by your script are found in /bin, you also need to set PATH to include a list of the directories containing those utilities.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

Script to launch terminal window?

Hi, I am a newbie here. Trying to find a way of writing a script to launch multiple terminal or console windows on solaris 9. I used to be able to do this using cmdtool on older versions of solaris and it was even possible to configure the size and screen position of the window and the title. ... (5 Replies)
Discussion started by: omerta
5 Replies

2. Shell Programming and Scripting

Need help writing an Applescript to launch a specific Terminal Command...

I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In... (3 Replies)
Discussion started by: JFraser1
3 Replies

3. OS X (Apple)

Need help writing an Applescript to launch a specific Terminal Command...

I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In the... (2 Replies)
Discussion started by: JFraser1
2 Replies

4. Programming

Redirecting Terminal to Local Application!

i wanted to execute some terminal commands on local linux, parse their output and display it to the user, i checked netcat source code but i couldnt understance it since im new to c (and linux at the same time). so i was wondering if there is away to run an instance of terminal hidden, read and... (15 Replies)
Discussion started by: JonhyM
15 Replies

5. Shell Programming and Scripting

How do I launch a command on an existing terminal in unix using PERL

Hello, I have a PERL-TK based GUI from which I want to launch a command on an existing UNIX terminal (this is also the parent terminal for this perl based gui window). The command I want to launch is interactive (there is no intention to interact with that command from the same PERL gui i.e. no... (2 Replies)
Discussion started by: AnuragJindal
2 Replies

6. OS X (Apple)

Can't launch x11 remotely from terminal

After I installed OS X Lion I haven't been able to launch x11 remotely (using ssh) from Terminal. It works fine locally, and also remotely directly from the Xterm. I log in to the unix server at my university from the terminal like this: ssh -l -X login@host.com This used to launch... (1 Reply)
Discussion started by: gnyrf
1 Replies

7. Red Hat

Not able to see the terminal icon in the applications menu to launch the command prompt in Centos

After installing centos iam not able to see the terminal icon in the applications menu to launch the command prompt in Centos. However iam able to see the Open Terminal menu, when i right click and it is not working. let me know what are the things i need to check.:b: (1 Reply)
Discussion started by: Kesavan
1 Replies

8. UNIX for Dummies Questions & Answers

pbpaste to application in terminal

Is it possible to execute a pbpaste command to an application or current application in focus? Thanks (0 Replies)
Discussion started by: fhill2
0 Replies

9. UNIX for Dummies Questions & Answers

Routing command to another graphical terminal

So, I'm in a graphical terminal (xfce4-terminal) and I was wondering, would there be a way to type a command, and it run in a new terminal window?? An example would be like, say that I want to open a .txt file, but I want it in a different window, instead of the one that I'm currently using because... (1 Reply)
Discussion started by: Huitzilopochtli
1 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
EXO-OPEN(1)							Xfce User's Manual						       EXO-OPEN(1)

NAME
exo-open - Open URLs and launch preferred applications SYNOPSIS
exo-open [[url]...] exo-open --launch [category] [[parameter]...] DESCRIPTION
exo-open is a command line frontend to the Xfce Preferred Applications framework. It can either be used to open a list of urls with the default URL handler or launch the preferred application for a certain category. INVOCATION
exo-open either takes a list of URLs and tries to open each of them using the default handler, or, when using the --launch tries to launch the preferred application for a certain category, optionally passing any number of parameters to the application. Options -?, --help Print brief help and exit. -v, --version Print version information and exit. --working-directory directory When using the --launch option and this option is specified as well, the application will be run in the given directory. This is primarily useful when running the preferred TerminalEmulator from another application and you want the command in the terminal window to be run in a specific directory. --launch category parameters... Launch the preferred application for the given category with the optional parameters..., where category is either WebBrowser, MailReader or TerminalEmulator. If you do not specify the --launch option, exo-open will open all specified URLs with their preferred URL handlers. Else, if you specify the --launch option, you can select which preferred application you want to run, and pass additional parameters to the application (i.e. for TerminalEmulator you can pass the command line that should be run in the terminal). COMPOSING EMAILS
exo-open allows users and developers to open the preferred email composer from the command line by simply invoking exo-open mailto:USER@HOST.TLD. This will open the composer window with USER@HOST.TLD as the recipient. This syntax is supported by all MailReaders. In addition the MailReaders that ship as part of libexo also support extended mailto:-URIs (but be aware that user-defined mailers do not necessarily support this), which allows you to also specify default values for the subject and the body of the mail, add additional recipients (both Cc: and To:) and attach files to emails. For example mailto:foo@foo.org?cc=bar@bar.org&subject=Foo&attach=/foo/bar.txt tells the composer to start an email to foo@foo.org and bar@bar.org with Foo in the subject and the file /foo/bar.txt attached to the message. AUTHOR
exo-open was written by Benedikt Meurer benny@xfce.org. This manual page was provided by Benedikt Meurer benny@xfce.org. Xfce 12/12/2009 EXO-OPEN(1)
All times are GMT -4. The time now is 01:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy