BashScripts.org
http://bashscripts.org/forum/

pass a variable to a text file
http://bashscripts.org/forum/viewtopic.php?f=8&t=348
Page 1 of 1

Author:  epifanio [ Sun Feb 18, 2007 2:13 pm ]
Post subject:  pass a variable to a text file

Hi, i need some help to a simple task.
i'm newbie :-(

i've a script like this :

echo "read insert"
read coords_thre
echo '
LX=load("$coords_thre");
' > Octave_temp.m
octave Octave_temp.m

when the echo ask me to a "read insert"
i type in my shell :

/Users/home/folder/filename

my targhet is to have as result, a file named : Octave_temp.m

in it i must have a simple line like :

LX=load('/Users/home/folder/filename');

my script is wrong, it give me a line like this :

LX=load("$coords_thre");

instead of the right results:
LX=load('/Users/home/folder/filename');

thanks for any suggestion !

Author:  epifanio [ Sun Feb 18, 2007 2:43 pm ]
Post subject: 

hi,
i fix my issue using :

echo "read insert"
read coords_thre
echo "
LX=load('${coords_thre}');
" > Octave_temp.m
octave Octave_temp.m

:-)

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group • http://www.phpbb.com