Sponsored Content
Top Forums Shell Programming and Scripting Setting variables in a function Post 302069820 by BCarlson on Wednesday 29th of March 2006 10:15:22 AM
Old 03-29-2006
I fugured it out!!!

All I needed to do what change this:

for i in `cat /tmp/result$$`
do
cmd=$i
$cmd
done


To this:

for i in `cat /tmp/result$$`
do
cmd=$i
export $cmd
done
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

setting environment variables ???

Hello, I want to set some environment variables with this script: ip=$@ echo Remote Computer: $ip PERLDB_OPTS="CallKomodo=$ip:9000 RemotePort=$ip:9010 PrintRet=0" export PERLDB_OPTS PERL5LIB=/opt/komodo export PERL5LIB echo PERLDB_OPTS: $PERLDB_OPTS echo PERL5LIB: $PERL5LIB But it... (5 Replies)
Discussion started by: Gargamel
5 Replies

2. UNIX for Dummies Questions & Answers

Setting numbered variables

Normally I would post in the shell scripting area, but this is so basic I thought I'd best put it in the dummy area! I want to set a series of numbered variables. I have a loop which increments a variable called $i with each loop. I want to name variables with this number e.g. var1, var2, var3... (1 Reply)
Discussion started by: michaeltravisuk
1 Replies

3. UNIX for Advanced & Expert Users

setting some variables

i have a file .NAMEexport MY_NAME=JOE when i do this at the command prompt #. .NAME $echo MY_NAME $JOEi created a script called Run.sh . .NAME At the command prompt i did #sh Run.sh #echo $MY_NAMEit returns nothing. What have i missed out? (7 Replies)
Discussion started by: new2ss
7 Replies

4. UNIX for Dummies Questions & Answers

Setting up variables

Hi all, I have a shell script that sets up the environment for an application running on UNIX - ksh. This script is run using: . ./script_name XX where XX is a parameter. I want to run it from another shell script but when I do it I don't get the envornment variables set up and the prompt... (3 Replies)
Discussion started by: solar_ext
3 Replies

5. UNIX for Dummies Questions & Answers

Need help with setting up environment variables

hi all, I would appreciate if some one could explain me the difference between setting up the variables as shown below HOME=${HOME:-"/home/user1"} HOME=/home/user1 (1 Reply)
Discussion started by: SSSB
1 Replies

6. UNIX for Dummies Questions & Answers

Setting Environment Variables

#!/bin/bash if ; then ASS1_DATA_DIR=./ echo $ASS1_DATA_DIR export ASS1_DATA_DIR echo "data dir" fi if ; then ASS1_OUTPUT_DIR=./ export ASS1_OUTPUT_DIR fi I want to create a new environment variable ASS1_DATA_DIR and ASS1_OUTPUT_DIR in bash and set them to the current... (4 Replies)
Discussion started by: bigubosu
4 Replies

7. UNIX for Dummies Questions & Answers

Setting up environment variables

Hi all, This is my first post here. I need to set up a few environment variables with a shell script. Some are hard-coded, but some should come from other commands or as input from the user. How do I do that? For example, I need to export a variable as such: export DISPLAY=127.0.0.1:8.0 ... (2 Replies)
Discussion started by: exchequer598
2 Replies

8. Shell Programming and Scripting

setting and displaying variables

Hello, I need a little help. 1. Edit /etc/profile so that all users are greeted upon login. 2. For the root account, set the prompt to something like "Danger!! root is doing stuff in \w", preferably in a bright color such as red or pink or in reverse video mode. Thanks for help. (4 Replies)
Discussion started by: zhshqzyc
4 Replies

9. Shell Programming and Scripting

Passing variables and setting them

So I'm writing a script to generate pairwise scores for how similar two strings are, and while I've been able to get it to work on a single script, I've been unable to iterate it. So suppose I have a file thus 1234567890 1234567890 1234567899 first I need to assign two lines, by their... (3 Replies)
Discussion started by: viored
3 Replies

10. UNIX for Beginners Questions & Answers

Setting variables in UNIX

Hi, I am a beginner in Unix. Now I am learning setting up variables. However, I am receiving an error. Can anyone please help me with it My command as Test=unixprogramming returns the error command not found. (I am using FreeBSD Unix and in my terminal, it is ~% instead of $ . is the... (2 Replies)
Discussion started by: kgopan
2 Replies
gnome-printinfo(1)						   User Commands						gnome-printinfo(1)

NAME
gnome-printinfo - GNOME print manager SYNOPSIS
gnome-printinfo [--default] [--edit] [--printer=printer] [--open=printer] [--edit-path=default-source-file] [gnome-std-options] DESCRIPTION
The GNOME Print Manager application enables you to control and manage printers and print jobs. You can use GNOME Print Manager to perform the following tasks: o Detect existing printers o Choose which printer to use for different documents o View a list of the print jobs that are queued on each printer o Cancel print jobs that are queued OPTIONS
The following options are supported: -d, --default Shows the printer queue for the default printer only. -e, --edit Allows the superuser to edit the default label, icon and description of printers, for the current LANG setting. --edit-path=default-source-file Allows the superuser to edit the printer default settings for the GConf source specified. -o, --open=printer Opens the printer queue window for the specified printer. -p, --printer=printer Shows the printer queue window for the specified printeronly. gnome-std-options Standard options available for use with most GNOME applications. See gnome-std-options(5). EXAMPLES
Example 1: Launching GNOME Print Manager to show the default printer only: example% gnome-printinfo -d Example 2: Launching GNOME Print Manager to show printer "prn004001": example% gnome-printinfo -p prn004001 ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables: REQ_DIR Used to store print requests. If not set, defaults to /var/spool/lp/requests/%s/ TMP_DIR Used to store local print jobs. If not set, defaults to /var/spool/lp/tmp LANG Current language setting. DEF_PRN Current default printer. PRINTER Current printer. LPDEST Destination printer for lp. EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-printinfo Executable for GNOME print manager ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-print | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
GNOME Print Manager Manual Latest version of the GNOME Desktop User Guide for your platform. lp(1), lp(7D), cancel(1), enable(1), lpq(1B), lpr(1B), lprm(1B), lpstat(1), postprint(1), pr(1), stty(1), accept(1M), lpadmin(1M), lpfil- ter(1M), lpforms(1M), lpmove(1M), lpsched(1M), lpshut(1M), lpsystem(1M), lpusers(1M), printers(4), printers.conf(4), attributes(5), envi- ron(5), gnome-std-options(5) NOTES
Written by Matt Keenan, Sun Microsystems Inc., 2003, 2006. SunOS 5.11 2 Oct 2003 gnome-printinfo(1)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy