The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: eval a variable that has a .
forumrating
Newbie
Rank: 1



UID 149
Digest Posts 0
Credits 0
Posts 113
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:17 AM  Profile | P.M. 
eval a variable that has a .



eval a variable that has a .



hi,

is there any way that i can eval the following -

eval abc.csv=def.csv


i am getting the - bash: command not found error.


Top
MassBile
Newbie
Rank: 1



UID 253
Digest Posts 0
Credits 0
Posts 20
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:17 AM  Profile | P.M. 
eval is a no-op in this case. if you "eval abc.csv=def.csv", you will just get "abc.csv=def.csv". so far, so good. so yes you can eval that. but then you need to execute the command "abc.csv=def.csv". "abc=def" would have worked because abc is a valid name for a variable. but abc.csv is not a variable name. so the shell tries to find a command called "abc.csv=def.csv". if it had found such a command, it would run it. but you don't have a command by that name. what did expect to do with this statement?
Top
htmlindex
Newbie
Rank: 1



UID 178
Digest Posts 0
Credits 0
Posts 22
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:17 AM  Profile | P.M. 
i am trying to rename the files.
Top
EV1L
Newbie
Rank: 1



UID 139
Digest Posts 0
Credits 0
Posts 28
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:18 AM  Profile | P.M. 
that is just:
mv abc.csv def.csv
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:38 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005362 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP