![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| assign awk's variable to shell script's variable? | tiger2000 | Shell Programming and Scripting | 3 | 3 Weeks Ago 04:47 AM |
| Insert a line including Variable & Carriage Return / sed command as Variable | lowmaster | Shell Programming and Scripting | 2 | 05-19-2009 11:26 PM |
| Sed variable substitution when variable constructed of a directory path | alrinno | Shell Programming and Scripting | 2 | 07-11-2008 02:24 PM |
| Enviornment Variable in B shell (I call it nested variable) | princelinux | Shell Programming and Scripting | 4 | 07-02-2008 01:35 AM |
| passing a variable inside a variable to a function | KingVikram | UNIX for Dummies Questions & Answers | 2 | 01-14-2008 08:28 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi.
Using eval: Code:
b=a eval $b=1 echo $a 1 |
| Bits Awarded / Charged to scottn for this Post | |||
| Date | User | Comment | Amount |
| 3 Weeks Ago | chebarbudo | Thanks for your help | 100 |
|
|||||
|
Quote:
Quote:
|
| Bits Awarded / Charged to cfajohnson for this Post | |||
| Date | User | Comment | Amount |
| 3 Weeks Ago | chebarbudo | A very complete answer, thanks for your time | 150 |
|
|||||
|
Thanks very much scottn and cfajohnson, it all works.
By the way, I just heard about the usage of bits as rewards for people who help others on the forum. It looks like I already earned some. It's a bit embarassing to ask but what is a reasonable number of bits to reward someone for helping me on that subject? Thanks for helping me being a better programmer and a more civilized forum user. |
|
||||
|
You seemed civilised to me anyway ;-)
I try to give bits on how useful I find the answer is to me (even though I didn't ask the question). Save your bits for a rainy day. Last edited by scottn; 3 Weeks Ago at 11:45 AM.. |
|
|||||
|
Hey masters,
What's wrong with my syntax? Code:
r29829:~# cat conf
A=1
B=2
C=3
r29829:~# cat testconf.sh
#!/bin/bash
cat conf | while IFS="=" read lvalue rvalue; do
eval $lvalue=$rvalue
done
echo "-$A-$B-$C-"
r29829:~# ./testconf.sh
----
Code:
r29829:~# ./testconf.sh -1-2-3- Thanks for your help. |
![]() |
| Bookmarks |
| Tags |
| variable |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|