C-shell: variable syntax question


 
Thread Tools Search this Thread
Operating Systems Solaris C-shell: variable syntax question
# 1  
Old 01-30-2007
C-shell: variable syntax question

There is a possibility to set a variable, having an another variable in it's name:
prompt% setenv PRT one
prompt% setenv VAR_${PRT} value
prompt%

So, this way the VAR_one = "value" and could be viewed:
prompt% echo VAR_one
value
prompt%

Q: How to view a variable having another var in it's name?
The echo $VAR_${PRT} or echo ${VAR_${PRT}} does not work
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question regarding quotation syntax

Hey guys, my first post on UNIX Forums(much overdue IMO)! I've got this bit of code that doesn't seem to be working correctly for an Android app I'm working on: "screen -S gmod1 -p 0 -X stuff " & "" & command.text & "`echo -ne '\015'`""" Basically it types command.text(variable determined... (4 Replies)
Discussion started by: stingwraith
4 Replies

2. Shell Programming and Scripting

A Perl Syntax Question.

Greetings! Here's what I believe is a "simple one" for the community tonight ;) What I'm trying to do is assign a "true/false" value to a variable depending upon whether a named process (some-process) exists; and then test for this value in the succeeding logic. I banged my head against the... (2 Replies)
Discussion started by: LinQ
2 Replies

3. Shell Programming and Scripting

Variable syntax error in $?

hi all , i just tried to take the status of previous command inside the script using echo $?. It throws me a variable syntax error , but when i use echo $? as an individual command it works perfectly . can anyone Please tell me why am getting a variable syntax error when i use echo $?... (7 Replies)
Discussion started by: Rahul619
7 Replies

4. Shell Programming and Scripting

Cleaner way to use shell variable in awk /X/,/Y/ syntax?

$ cat data Do NOT print me START_MARKER Print Me END_MARKER Do NOT print me $ cat awk.sh start=START_MARKER end=END_MARKER echo; echo Is this ugly syntax the only way? awk '/'"$start"'/,/'"$end"'/ { print }' data echo; echo Is there some modification of this that would work? awk... (2 Replies)
Discussion started by: hanson44
2 Replies

5. Shell Programming and Scripting

Question about syntax error

first of all.. sorry about all the question bombing.. im bored atm so im currently playing around with sh scripting hehe s = `expr ls -s Documents | grep Music | awk '{ print $1 }' ` t = `expr $t + $s` it give syntax error s not found t not found lol... any idea why? (7 Replies)
Discussion started by: Nick1097
7 Replies

6. Shell Programming and Scripting

Question about Special Shell Variable "$-"

Question: How I can change the shell option in my current environment, which I want to change the result of the command echo $-. Background: Special variable $-. It means the current shell option, and in my ENV, the result of this command as follows. -bash-3.2$ echo $- himBH -bash-3.2$ ... (2 Replies)
Discussion started by: ambious
2 Replies

7. Shell Programming and Scripting

awk syntax question

Hi I use awk command to delete the first blanc line of a file: awk '/^$/ && !f{f=1;next}1' infile > outfile can somebody please explain me what the last "1'" in !f{f=1;next}1' stands for... Thansk a lot -A (3 Replies)
Discussion started by: aoussenko
3 Replies

8. UNIX for Dummies Questions & Answers

AWK syntax question

Hi, Have to check file names in some given directory. SO, What is the right syntax here: *$3*=="'$object_list'" - just wanted to check if $3 is in the object_list. And also, Do I need so many quotes around? (5 Replies)
Discussion started by: Leo_NN
5 Replies

9. UNIX for Dummies Questions & Answers

Setting a variable (need syntax help)

I need some syntax help (working in a bash shell) I have a variable which is a filename with an extension, and I need to create another variable with the same name but a different extension To explain, the input file should be called something like "filename.L1" and the output file should be... (1 Reply)
Discussion started by: Slanter
1 Replies

10. Shell Programming and Scripting

Syntax to export any variable

How to export variables on a UNIX prompt. Please provide me syntax. Thanks in advance. Malay (5 Replies)
Discussion started by: malaymaru
5 Replies
Login or Register to Ask a Question
VDETAPLIB(1)						      General Commands Manual						      VDETAPLIB(1)

NAME
vdetaplib - Virtual Distributed Ethernet tap emulation library SYNOPSIS
No synopsis DESCRIPTION
vdetaplib is a library that emulates tap (tuntap level2 interface, see in kernel sources Documentation/networking/tun.c) and connects tap virtual interfaces to vde networks. To use it, the libvdetab.so library must be preloaded (sh, ksh or bash syntax): export LD_PRELOAD=/usr/lib/vde2/libvdetap.so (csh, tchs syntax): setenv LD_PRELOAD /usr/lib/vde2/libvdetap.so If you want to divert all tap requests to a single vde_switch set the variable VDEALLTAP to the vde socket. (sh, ksh or bash syntax): export VDEALLTAP=/tmp/vde.ctl (csh, tchs syntax): setenv VDEALLTAP /tmp/vde.ctl It is possible to set each single interface to different vde_switches by setting the environment variable with the same name of the inter- face. (sh, ksh or bash syntax): export tap0=/tmp/vde.ctl export tap1=/tmp/myvde.ctl export ppc=/tmp/ppc.ctl (csh, tchs syntax): setenv tap0 /tmp/vde.ctl setenv tap1 /tmp/myvde.ctl setenv ppc /tmp/ppc.ctl It is also possible to specify port, group or mode for a given interface setting environment variables as in the following example. (sh, ksh or bash syntax): export tap0_port=5 export tap0_group=vde-net export tap0_mode=0660 (csh, tchs, syntax): setenv tap0_port 5 setenv tap0_group vde-net setenv tap0_mode 0660 The variable to set the specific interface is checked first then VDEALLTAP. VDEALLTAP thus works as a default choice for the vde switch to be used. If VDEALLTAP is not set and there is no specific environment variable (and for tun -- IFF_TUN interfaces) the kernel provided interface is used. In this latter case access to /dev/net/tun is required, generally root access. NOTICE
Virtual Distributed Ethernet is not related in any way with www.vde.com ("Verband der Elektrotechnik, Elektronik und Informationstechnik" i.e. the German "Association for Electrical, Electronic & Information Technologies"). SEE ALSO
vde_switch(1), vdeq(1). AUTHOR
VDE is a project by Renzo Davoli <renzo@cs.unibo.it> Virtual Distributed Ethernet December 6, 2006 VDETAPLIB(1)