Sponsored Content
Top Forums Shell Programming and Scripting set variable with another variable? c shell Post 302169998 by ynixon on Saturday 23rd of February 2008 01:38:00 PM
Old 02-23-2008
Wrong:

set ${$pe} = M

Good:
set pe = M
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Set Path variable in c shell

I set my path environment variable in c shell, using the syntax below setenv PATH "${PATH}:/usr/local:/usr/local/bin" and placed this in $HOME/.login $HOME/.cshrc and /etc/.login /etc/.cshrc but when I issued echo $PATH or set command the output does not reflect changes made to... (5 Replies)
Discussion started by: hassan2
5 Replies

2. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

3. Shell Programming and Scripting

problem in getting the path of environment variable set in bashrc in my shell script

hi all i have joined new to the group. i have set an variable in my bashrc file. .bashrc PROGHOME=/home/braf/braf/prog export PROGHOME but while using it in my shell script its path is not taken and i had to explicitly give the export command to set the path. in my script... (8 Replies)
Discussion started by: krithika
8 Replies

4. Shell Programming and Scripting

How to make nawk to set a shell variable

Below is the content of the file I am parsing bash-2.03$ cat rakesh cpio: Cannot write "reloc/lib/gcc-lib/i386-pc-solaris2.7/2.95.2/gmon.o", errno 28, No space left on device cpio: Cannot write "reloc/lib/gcc-lib/i386-pc-solaris2.7/2.95.2/include/README", errno 28, No space left on device... (1 Reply)
Discussion started by: rakeshou
1 Replies

5. Shell Programming and Scripting

Set/Export Env Vars from with Shell Script With Input Variable

I have a shell script I want to run that will set environment variables based on the value of an input variable submitted when the shell script is called. For example: $ mgenv.sh prod This would set environment variables for prod $ mgenv.sh test This would set environment variables... (1 Reply)
Discussion started by: brtaylor73
1 Replies

6. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

7. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

8. Shell Programming and Scripting

how to set/get shell env variable in python script

greetings, i have a sh script that calls a python script. the sh script sets an env variable BIN: export BIN=bin64i need to get that BIN variable's value and use it within this python script. anyone know how to do this? thanx in advance. (5 Replies)
Discussion started by: crimso
5 Replies

9. Shell Programming and Scripting

Set shell variable from command

shell script has a command inside back quotes in method update_TABLE I need to store the count of number of Rows updated and store it in shell script variable "num" num = 0; Update_TABLE Update_TABLE() { `echo " set verify off feedback off echo off pagesize 0 head off... (4 Replies)
Discussion started by: finder255
4 Replies

10. Shell Programming and Scripting

set variable with square brackets in c shell!

Hi Guys, I want to set a variable which happend to have square brackets in them. I tried multiple ways that is by escaping it with quotes (both single and double ) but it didn't help. All I want is: set x = slicearray.slice\.post My failed attempts were: set x = "slicearray.slice\.post"... (3 Replies)
Discussion started by: dixits
3 Replies
Log::Message::Simple(3perl)				 Perl Programmers Reference Guide			       Log::Message::Simple(3perl)

NAME
Log::Message::Simple - Simplified interface to Log::Message SYNOPSIS
use Log::Message::Simple qw[msg error debug carp croak cluck confess]; use Log::Message::Simple qw[:STD :CARP]; ### standard reporting functionality msg( "Connecting to database", $verbose ); error( "Database connection failed: $@", $verbose ); debug( "Connection arguments were: $args", $debug ); ### standard carp functionality carp( "Wrong arguments passed: @_" ); croak( "Fatal: wrong arguments passed: @_" ); cluck( "Wrong arguments passed -- including stacktrace: @_" ); confess("Fatal: wrong arguments passed -- including stacktrace: @_" ); ### retrieve individual message my @stack = Log::Message::Simple->stack; my @stack = Log::Message::Simple->flush; ### retrieve the entire stack in printable form my $msgs = Log::Message::Simple->stack_as_string; my $trace = Log::Message::Simple->stack_as_string(1); ### redirect output local $Log::Message::Simple::MSG_FH = *STDERR; local $Log::Message::Simple::ERROR_FH = *STDERR; local $Log::Message::Simple::DEBUG_FH = *STDERR; ### force a stacktrace on error local $Log::Message::Simple::STACKTRACE_ON_ERROR = 1 DESCRIPTION
This module provides standardized logging facilities using the "Log::Message" module. FUNCTIONS
msg("message string" [,VERBOSE]) Records a message on the stack, and prints it to "STDOUT" (or actually $MSG_FH, see the "GLOBAL VARIABLES" section below), if the "VERBOSE" option is true. The "VERBOSE" option defaults to false. Exported by default, or using the ":STD" tag. debug("message string" [,VERBOSE]) Records a debug message on the stack, and prints it to "STDOUT" (or actually $DEBUG_FH, see the "GLOBAL VARIABLES" section below), if the "VERBOSE" option is true. The "VERBOSE" option defaults to false. Exported by default, or using the ":STD" tag. error("error string" [,VERBOSE]) Records an error on the stack, and prints it to "STDERR" (or actually $ERROR_FH, see the "GLOBAL VARIABLES" sections below), if the "VERBOSE" option is true. The "VERBOSE" options defaults to true. Exported by default, or using the ":STD" tag. carp(); Provides functionality equal to "Carp::carp()" while still logging to the stack. Exported by using the ":CARP" tag. croak(); Provides functionality equal to "Carp::croak()" while still logging to the stack. Exported by using the ":CARP" tag. confess(); Provides functionality equal to "Carp::confess()" while still logging to the stack. Exported by using the ":CARP" tag. cluck(); Provides functionality equal to "Carp::cluck()" while still logging to the stack. Exported by using the ":CARP" tag. CLASS METHODS
Log::Message::Simple->stack() Retrieves all the items on the stack. Since "Log::Message::Simple" is implemented using "Log::Message", consult its manpage for the function "retrieve" to see what is returned and how to use the items. Log::Message::Simple->stack_as_string([TRACE]) Returns the whole stack as a printable string. If the "TRACE" option is true all items are returned with "Carp::longmess" output, rather than just the message. "TRACE" defaults to false. Log::Message::Simple->flush() Removes all the items from the stack and returns them. Since "Log::Message::Simple" is implemented using "Log::Message", consult its manpage for the function "retrieve" to see what is returned and how to use the items. GLOBAL VARIABLES
$ERROR_FH This is the filehandle all the messages sent to "error()" are being printed. This defaults to *STDERR. $MSG_FH This is the filehandle all the messages sent to "msg()" are being printed. This default to *STDOUT. $DEBUG_FH This is the filehandle all the messages sent to "debug()" are being printed. This default to *STDOUT. $STACKTRACE_ON_ERROR If this option is set to "true", every call to "error()" will generate a stacktrace using "Carp::shortmess()". Defaults to "false" perl v5.14.2 2011-09-19 Log::Message::Simple(3perl)
All times are GMT -4. The time now is 10:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy