Gentoo Archives: gentoo-user

From: davidgn@×××××××××××××.mx
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: [OT] Bash scripting
Date: Fri, 11 Nov 2005 16:41:29
Message-Id: 1131726881.4374c821aeee5@www.correo.unam.mx
In Reply to: [gentoo-user] Re: [OT] Bash scripting by Peper
1 Quoting Peper <peper@×××××.pl>:
2
3 > > try
4 > > blah=`pwd`'/blah'
5 > >
6 > > *Note the single quotes do not enclose `pwd`
7 >
8 > I know how to use `command`, but the problem is that i read blah from
9 > file.
10 > blah=`head -n x file|tail -n 1` and in the file i have lines `pwd`/blah.
11 >
12 > $ echo $blah
13 > `pwd`/blah
14 >
15 > This is the problem.
16 >
17
18 try with eval then:
19
20
21 dabicho@localhost ~ $ a='`pwd`/Ranma'
22 dabicho@localhost ~ $ echo $a
23 `pwd`/Ranma
24 dabicho@localhost ~ $ eval cd $a
25 dabicho@localhost ~/Ranma $ pwd
26 /home/dabicho/Ranma
27 dabicho@localhost ~/Ranma $ cd -
28 /home/dabicho
29 dabicho@localhost ~ $ eval echo $a
30 /home/dabicho/Ranma
31
32 hope that helps
33
34
35 -------------------------------------------------
36 www.correo.unam.mx
37 UNAMonos Comunicándonos
38
39 --
40 gentoo-user@g.o mailing list

Replies

Subject Author
[gentoo-user] Re: [OT] Bash scripting Peper <peper@×××××.pl>