![]() |
|
|
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 |
| shell programming | nivas | Shell Programming and Scripting | 8 | 02-11-2008 12:06 PM |
| Aix Shell Programming | akmtcs | AIX | 1 | 12-07-2006 08:40 AM |
| shell programming | Neha Agarwal | Shell Programming and Scripting | 2 | 09-07-2005 03:23 AM |
| Shell Programming Help | mec585858 | UNIX for Dummies Questions & Answers | 4 | 12-10-2003 10:24 AM |
| Shell Programming | JWK1 | UNIX for Dummies Questions & Answers | 2 | 06-01-2001 02:31 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
{} in shell programming
Could someone please tell me what {} mean when they surround a variable?
For instance, $FILE = 'basename $1' //what is passed into this script $BANK = 'dirname $1' $INFILE = ${FILE}.${BANK}.$$ What does $INFILE contain after this assignment? Please let me know Thanks G |
|
||||
|
See below ....
$vi a.sh ab=$(pwd) echo " " echo "Current working directory is $ab" FILE=$(basename $ab) echo "FILE returns $FILE " echo " " ab=$(pwd) echo "Current working directory is $ab" BANK=$(dirname $ab) echo "BANK returns $BANK" echo " " INFILE=${FILE}.${BANK}.$$ echo $INFILE dam@athena:~$ ./a.sh Current working directory is /home/dam FILE returns dam Current working directory is /home/dam BANK returns /home dam./home.11937 Not sure what you are trying to achieve... I think what you probably wanted was /home/dam.11937 |
|
|||||
|
#!/bin/bash
X=ABC echo "$Xabc" THis gives no output. What went wrong ? The answer is that the shell thought that we were asking for the variable Xabc, which is uninitialised. The way to deal with this is to put braces around X to seperate it from the other characters. The following gives the desired result: #!/bin/bash X=ABC echo "${X}abc" ------------------ I think that it will clear your doubt. still you are not getting ...pls give full details so that we can give a solution of same Thanks Ckanth |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|