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
XMMS2-LAUNCHER(1)					      General Commands Manual						 XMMS2-LAUNCHER(1)

NAME
xmms2-launcher - XMMS2 daemon launcher SYNOPSIS
xmms2-launcher [ -? / --help ] xmms2-launcher [ -l logfile / --logfile= logfile] [ -P pidfile / --pidfile= pidfile] [ --verbose ] DESCRIPTION
XMMS2 is a redesign of the XMMS (http://www.xmms.org) music player. It features a client-server model, allowing multiple (even simultane- ous!) user interfaces, both textual and graphical. All common audio formats are supported using plugins. On top of this, there is a flexi- ble media library to organise your music. xmms2-launcher starts xmms2d(1) in the background. The main feature is that it does not exit until the IPC system of XMMS2 is available, meaning that as soon as the xmms2-launcher process has exited successfully xmms2d(1) is ready to accept commands. xmms2-launcher includes command line options to change the way in which the daemon is invoked. These options are currently recognised: -l logfile / --logfile=logfile Write log file to logfile instead of the default log file location - P pidfile / --pidfile=pidfile Write the pid of xmms2d to the file specified by pidfile --verbose Increases the vebosity of xmms2-launcher -? / --help Show help options FILES
$XDG_CACHE_HOME/xmms2/xmms2d.log The default location for a file where the log output of xmms2d(1) is redirected. Usually ~/.cache/xmms2/xmms2d.log. SEE ALSO
xmms2d(1), http://xmms2.xmms.org HISTORY
The XMMS2 Project was started by Tobias Rundstrom and Anders Gustafsson. It is developed with their lead by a small group of contributers from all over the world. AUTHOR
This manual page was written by Alexander Botero-Lowry <alex@foxybanana.com> XMMS2-LAUNCHER(1)
All times are GMT -4. The time now is 01:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy