Sponsored Content
Top Forums Shell Programming and Scripting Help with making the output of a command a variable Post 303034613 by Defunct_Lizard on Tuesday 30th of April 2019 08:38:29 PM
Old 04-30-2019
Help with making the output of a command a variable

I'm writing a script that goes something like this:

Code:
#!/bin/bash

zenity --list --checklist --title="Choose Packages to Install" --width="1000" --height="400" \
--column="Select" --column="Package Name" --column="Description" \
GIMP=$( " " GIMP "GIMP is a free and open source photo editor."  \ )
if [ $GIMP == "GIMP" ]
then 
	sudo apt-get install $GIMP
fi

I want to open a dialog box with check boxes, package names, and descriptions. The box I have written is the first attached file.

I plan on adding other programs, but I have not gotten there yet.

The
Code:
" "

in the line
Code:
" " GIMP "Known as GIMP, GNU Image Manipulation Program is a free and open source photo editor." \

is for the first checkbox.

My main problem is the quotation marks at the end and beginning of the line (attached file #2). The quotation marks read in the wrong direction, and not how I want them to, having quotation marks inside of quotation marks?

Is there any way to fix this? Do I need to take a completely different approach?
Help with making the output of a command a variable-dialogbox10png
Help with making the output of a command a variable-zenity1png

Last edited by Defunct_Lizard; 04-30-2019 at 10:15 PM.. Reason: I did not intend for the attached files not to be alongside the text.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command output to a variable.

With cut -c 8-13 myfile, I am getting some numeric value. In my shell script I am trying to assign something like this, var=cut -c 8-13 myfile But at the time of execution I am getting -c is not found. If I dont assign, then script executes well. Can we not simply use the value from one... (8 Replies)
Discussion started by: videsh77
8 Replies

2. UNIX for Dummies Questions & Answers

redirect command output to variable

Hi, I am looking for a way to redirect the result from a command into a variable. This is the scenario. Using the find command I will be getting multiple records/lines back. Here is the command I am using: find /”path”/ -name nohup.out -print This now is giving me the paths and file... (1 Reply)
Discussion started by: hugow
1 Replies

3. Shell Programming and Scripting

get characters from output of a command in a variable

Hi, i have two questions, I am new to programming 1. I have an output of a command and i want to get some specific part of it in a variable. i am trying sr=`some comand xyz| grep 'Last Changed Rev:' | cut -c19-` now variable sr gets a end of line character at end. output of the command... (3 Replies)
Discussion started by: muaz
3 Replies

4. Shell Programming and Scripting

Assigning output of a command to variable

When I run time -p <command>, it outputs: real X.XX user X.XX sys X.XXwhere X.XX is seconds. How I can take just that first number output, the seconds of real time, and assign that to a variable? (9 Replies)
Discussion started by: jeriryan87
9 Replies

5. Programming

Command output into a variable

Hi, with this command: cu -l /dev/ttyACM0 -s 9600 > name.txt I put the output of the port in a txt Is posible to do the same (or similar) in a var directly, inside a C program? cu -l /dev/ttyACM0 -s 9600 > variable ? I have trying this withs pipes, but i dont know how to... (6 Replies)
Discussion started by: daaran
6 Replies

6. Shell Programming and Scripting

How to put output of one command into a variable

Hi, Let say I have these 3 files (state, list and myscript). I want to be able get the sample output like below when I run myscript. Any one know how to fix the code? TIA. ~~~~~~~~~~~~~~~ > cat /home/state CA > cat /home/list CA 100 50 20 AUS 120 61 10 > cat myscript... (6 Replies)
Discussion started by: joker_789us
6 Replies

7. Shell Programming and Scripting

Making script show command (e.g. copy) being executed and variable substitution?

When script is running you only see when some of the commands are not successfull. Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Discussion started by: gr0124
3 Replies

8. Shell Programming and Scripting

how to save an output of a command in a variable

Hi, in shell script, i have the command swstart -p which returns an output. i want to store the output of this command into a variable. how i can do that excerpt from the script #!/usr/bin/ksh # # # # Program: swstart -p # # Description: Starts the sentinels on Slave server ... (4 Replies)
Discussion started by: lookinginfo
4 Replies

9. UNIX for Advanced & Expert Users

ls output into a read command as a variable

I'm working on a short BASH script on my Ubuntu box that will run powerpoint scripts with MS Powerpoint Viewer 2007 via WINE. I can run the presentation when I run it manually but what i'd like to do is have the script look for the newest file then run it. #! /bin/sh # Start the newest... (2 Replies)
Discussion started by: binary-ninja
2 Replies

10. Shell Programming and Scripting

How to get the output of a ISQL command in a variable?

I am trying to run a query which returns a sum value(a number). I want to get it in a variable so that i can refer to that variable in different places. when i am running the following command variable=`isql -Uuser -Sserver -Ppassword 1> select sum(count(*)) from xyz..abc where clm_id... (2 Replies)
Discussion started by: Sharma331
2 Replies
GIMP(1) 							 GIMP Manual Pages							   GIMP(1)

NAME
gimp - an image manipulation and paint program. SYNOPSIS
gimp [-h] [--help] [--help-all] [--help-gtk] [-v] [--version] [--license] [--verbose] [-n] [--new-instance] [-a] [--as-new] [-i] [--no-interface] [-d] [--no-data] [-f] [--no-fonts] [-s] [--no-splash] [--no-shm] [--no-cpu-accel] [--display display] [--session <name>] [-g] [--gimprc <gimprc>] [--system-gimprc <gimprc>] [--dump-gimprc] [--console-messages] [--debug-handlers] [--stack-trace-mode <mode>] [--pdb-compat-mode <mode>] [--batch-interpreter <procedure>] [-b] [--batch <command>] [filename] ... DESCRIPTION
GIMP is the GNU Image Manipulation Program. It is used to edit and manipulate images. It can load and save a variety of image formats and can be used to convert between formats. GIMP can also be used as a paint program. It features a set of drawing and painting tools such as airbrush, clone, pencil, and paint brush. Painting and drawing tools can be applied to an image with a variety of paint modes. It also offers an extensive array of selection tools like rectangle, ellipse, fuzzy select, bezier select, intelligent scissors, and select by color. GIMP offers a variety of plug-ins that perform a variety of image manipulations. Examples include bumpmap, edge detect, gaussian blur, and many others. In addition, GIMP has several scripting extension which allow for advanced non-interactive processing and creation of images. GIMP ships with a second binary called gimp-console. This binary is a console-only version and behaves as if gimp was called with the --no-interface command-line option. On platforms with the D-Bus message bus system, GIMP will by default check if an instance is already running in this user session. If it detects that, it will pass all filenames given on the command-line to the already running GIMP instance and quit. OPTIONS
GIMP accepts the following options: -h, --help Show GIMP command-line options. --help-all Show all command-line options. --help-gtk Show GTK+ command-line options. --help-gegl Show GEGL command-line options. -v, --version Output version information and exit. When combined with the --verbose option, version information about libraries used by GIMP is shown as well. --license Output license information and exit. --verbose Be verbose and create information on standard output. -n, --new-instance Do not attempt to reuse an already running GIMP instance. Always start a new one. -a, --as-new Open filenames passed on the command-line as new images, don't set the filename on them. -i, --no-interface Run without a user interface. -d, --no-data Do not load patterns, gradients, palettes, or brushes. Often useful in non-interactive situations where startup time is to be mini- mized. -f, --no-fonts Do not load any fonts. No text functionality will be available if this option is used. --display display Use the designated X display. -s, --no-splash Do not show the splash screen. --no-shm Do not use shared memory between GIMP and its plug-ins. Instead of using shared memory, GIMP will send the data via pipe. This will result in slower performance than using shared memory. --no-cpu-accel Do not use CPU accelerations such as MMX or SSE even if GIMP detects that your CPU provides this functionality. --session <name> Use a different sessionrc for this GIMP session. The given session name is appended to the default sessionrc filename. -g, --gimprc <gimprc> Use an alternative gimprc instead of the default one. Useful in cases where plug-in paths or machine specs may be different. --system-gimprc <gimprc> Use an alternate system gimprc file. --dump-gimprc Output a gimprc file with default settings. --debug-handlers Enable debugging signal handlers. -c, --console-messages Do not popup dialog boxes on errors or warnings. Print the messages on the console instead. --stack-trace-mode {never|query|always} If a stack-trace should be generated in case of fatal signals. --pdb-compat-mode {off|on|warn} If the PDB should provide aliases for deprecated functions. --batch-interpreter <procedure> Specifies the procedure to use to process batch events. The default is to let Script-Fu evaluate the commands. -b, --batch <command> Execute <command> non-interactively. This option may appear multiple times. The <command> is passed to the batch interpreter. When <command> is - the commands are read from standard input. ENVIRONMENT
GIMP respects a number of environment variables. DISPLAY to get the default host and display number. GIMP2_DIRECTORY to get the name of the personal GIMP directory. If unset .gimp-2.6 is used. If this is an absolute path, it is used as is. If it is a relative path, it is taken to be a subdirectory of the home directory. GIMP2_DATADIR to get the base location for data files such as brushes and patterns. If unset /usr/share/gimp/2.0 is used. GIMP2_LOCALEDIR to get the base location for translations. If unset /usr/share/locale is used. GIMP2_PLUGINDIR to get the base location for plug-ins and modules. If unset /usr/lib64/gimp/2.0 is used. GIMP2_SYSCONFDIR to get the location of configuration files. If unset /etc/gimp/2.0 is used. On Linux GIMP can be compiled with support for binary relocatibility. This will cause data, plug-ins and configuration files to be searched relative to the location of the gimp executable file unless overridden by the environment variables mentioned above. FILES
GIMP's data files are stored in /usr/share/gimp/2.0, where ${datarootdir} is set on install, but is typically /usr/share. GIMP's system- wide configuration files are stored in /etc/gimp/2.0, where ${prefix} is typically /usr. Most GIMP configuration is read in from the user's init file, $HOME/.gimp-2.6/gimprc. The system wide equivalent is in /etc/gimprc. The system wide file is parsed first and the user gimprc can override the system settings. /etc/gimprc_user is the default gimprc placed in users' home directories the first time GIMP is run. $HOME/.gimp-2.6/devicerc - holds settings for input devices together with the tool, colors, brush, pattern and gradient associated to that device. $HOME/.gimp-2.6/gtkrc - users set of GIMP-specific GTK+ config settings. Options such as widget color and fonts sizes can be set here. /etc/gimp/2.0/gtkrc - sytem wide default set of GIMP-specific GTK+ config settings. $HOME/.gimp-2.6/menurc - user's set of keybindings. $HOME/.gimp-2.6/parasiterc - Stores all persistent GIMP parasites. This file will be rewritten every time you quit GIMP. $HOME/.gimp-2.6/sessionrc - This file takes session-specific info (that is info, you want to keep between two GIMP sessions). You are not supposed to edit it manually, but of course you can do. This file will be entirely rewritten every time you quit GIMP. If this file isn't found, defaults are used. $HOME/.gimp-2.6/templaterc - Image templates are kept in this file. New images can conveniently created from these templates. If this file isn't found, defaults are used. /etc/gimp/2.0/unitrc - default user unit database. It contains the unit definitions for centimeters, meters, feet, yards, typographic points and typographic picas and is placed in users home directories the first time GIMP is ran. If this file isn't found, defaults are used. $HOME/.gimp-2.6/unitrc - This file contains your user unit database. You can modify this list with the unit editor. You are not supposed to edit it manually, but of course you can do. This file will be entirely rewritten every time you quit GIMP. $HOME/.gimp-2.6/plug-ins - location of user installed plug-ins. $HOME/.gimp-2.6/pluginrc - plug-in initialization values are stored here. This file is parsed on startup and regenerated if need be. $HOME/.gimp-2.6/modules - location of user installed modules. $HOME/.gimp-2.6/tmp - default location that GIMP uses as temporary space. /usr/share/gimp/2.0/brushes - system wide brush files. $HOME/.gimp-2.6/brushes - user created and installed brush files. These files are in the .gbr, .gih or .vbr file formats. $HOME/.gimp-2.6/curves - Curve profiles and presets as saved from the Curves tool. $HOME/.gimp-2.6/gimpressionist - Presets and user created brushes and papers are stored here. $HOME/.gimp-2.6/levels - Level profiles and presets as saved from the Levels tool. /usr/share/gimp/2.0/palettes - the system wide palette files. $HOME/.gimp-2.6/palettes - user created and modified palette files. This files are in the .gpl format. /usr/share/gimp/2.0/patterns - basic set of patterns for use in GIMP. $HOME/.gimp-2.6/patterns - user created and installed gimp pattern files. This files are in the .pat format. /usr/share/gimp/2.0/gradients - standard system wide set of gradient files. $HOME/.gimp-2.6/gradients - user created and installed gradient files. /usr/share/gimp/2.0/scripts - system wide directory of scripts used in Script-Fu and other scripting extensions. $HOME/.gimp-2.6/scripts - user created and installed scripts. /usr/share/gimp/2.0/gflares - system wide directory used by the gflare plug-in. $HOME/.gimp-2.6/gflares - user created and installed gflare files. /usr/share/gimp/2.0/gfig - system wide directory used by the gfig plug-in. $HOME/.gimp-2.6/gfig - user created and installed gfig files. /usr/share/gimp/2.0/images/gimp-splash.png - the default image used for the GIMP splash screen. /usr/share/gimp/2.0/images/gimp-logo.png - image used in the GIMP about dialog. /usr/share/gimp/2.0/tips/gimp-tips.xml - tips as displayed in the "Tip of the Day" dialog box. SPLASH IMAGES
GIMP comes with a default image for the splash screen but it allows system administrators and users to customize the splash screen by pro- viding other images. The image to be used with the splash screen is chosen as follows: 1. GIMP tries to load a random splash screen from the directory $HOME/.gimp-2.6/splashes. 2. It then falls back to using $HOME/.gimp-2.6/gimp-splash.png. 3. If the user didn't install any custom splash images, a random image is picked from /usr/share/gimp/2.0/splashes. 4. As a last resort, GIMP uses the default splash image located at /usr/share/gimp/2.0/images/gimp-splash.png. SUGGESTIONS AND BUG REPORTS
Any bugs found should be reported to the online bug-tracking system available on the web at http://bugzilla.gnome.org/. Before reporting bugs, please check to see if the bug has already been reported. When reporting GIMP bugs, it is important to include a reliable way to reproduce the bug, version number of GIMP (and probably GTK+), OS name and version, and any relevant hardware specs. If a bug is causing a crash, it is very useful if a stack trace can be provided. And of course, patches to rectify the bug are even better. OTHER INFO
The canonical place to find GIMP info is at http://www.gimp.org/. Here you can find links to just about many other GIMP sites, tutorials, data sets, mailing list archives, and more. There is also a GIMP User Manual available at http://docs.gimp.org/ that goes into much more detail about the interactive use of GIMP. The latest version of GIMP and the GTK+ libs is always available at ftp://ftp.gimp.org/. AUTHORS
Spencer Kimball, Peter Mattis and the GIMP Development Team. With patches, fixes, plug-ins, extensions, scripts, translations, documentation and more from lots and lots of people all over the world. SEE ALSO
gimprc(5), gimptool(1), Version 2.6.8 March 23 2008 GIMP(1)
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy