The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Clouding and Confusing the CEP Community iBot Complex Event Processing RSS News 0 04-20-2008 04:40 AM
(Need Help) confusing format on solaris 10 bucci SUN Solaris 7 03-25-2008 04:23 AM
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 08:16 AM
error during run: St9bad_alloc - Getting this error while using some conversion progr sathu_pec Shell Programming and Scripting 1 01-20-2008 11:38 PM
Error: Internal system error: Unable to initialize standard output file firkus UNIX for Dummies Questions & Answers 2 10-25-2005 12:23 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-28-2008
Registered User
 

Join Date: Mar 2008
Posts: 11
Confusing Error

Hi all,

Just subscribed to this forum. Not a regular user of Unix.

I did the following:
We have a directory structure /a/b/c5/

Where c5 is the only directory inside b.
export ANOOP=/a/b/c*/
echo $ANOOP=/a/b/c5/

I have to create a symbolic link to anoop.txt in the directory /a/b/c5/d/.

ln -s $ANOOP/d/anoop.txt $ANOOP/d/anoop1.txt

ln: creating symbolic link `/a/b/c*/d/anoop1.txt` to `/a/b/c5/d/anoop.txt` : No such file or directory


When I tried echoing "$ANOOP/d" the whole path was printed(/a/b/c5/d), however when i tried to echo a non existing file in the same path it couldnt convert c* into c5. Which might have been the issue for the above link issue also.

echo $ANOOP/d/anoop1.txt=/a/b/c*/d/anoop1.txt.

Could any of you help me figure out any way to tackle this particular issue.
Reply With Quote
Forum Sponsor
  #2  
Old 03-28-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
The wildcard is expanded when you echo it, not when you assign it. Try adding those backticks which I otherwise always try to persuade people to avoid.

Code:
ANOOP=`echo /a/b/c*/`
set | fgrep ANOOP   # verify what's set without possibly expanding it
Reply With Quote
  #3  
Old 03-28-2008
Registered User
 

Join Date: Mar 2008
Posts: 11
Quote:
Originally Posted by era View Post
The wildcard is expanded when you echo it, not when you assign it. Try adding those backticks which I otherwise always try to persuade people to avoid.

Code:
ANOOP=`echo /a/b/c*/`
set | fgrep ANOOP   # verify what's set without possibly expanding it

Thanks a Lot era. My issue is solved. I could succesfully create the link.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0