On Sat Oct 21 2000 at 18:47, Chris Abbey wrote:
> I'm trying to write a script to automate the building of a symlink
> farm for the live NFS install tree from two CDs or ISOs... it
> would have been done hours ago except that I can't get basename
> to work inside a backtick expression like this:
>
> ln -s $fil `basename $fil`
Try it like this instead:
ls -s $fil $(basename $fil)
> where fil=/isos/rh/1/RedHat/base/comps and the end result of
> what I want is:
>
> ln -s /isos/rh/1/RedHat/base/comps comps
>
> but what I end up with is:
>
> ln -s /isos/rh/1/RedHat/base/comps /isos/rh/1/RedHat/base/comps
>
> basename works fine normaly from the command line:
>
> ~> basename /isos/rh/1/RedHat/base/comps
> comps
> ~>
>
> anybody got an idea??
Check out the bash man page - it claims that the $(<command>) syntax
is a lot cleaner with things like escaping and environment variables
than doing it with backticks. I migrated over to this format a
couple of years ago in my #!/bin/bash scripts and never had a
problem with it yet.
Cheers
Tony
-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-
Tony Nugent <[EMAIL PROTECTED]> Systems Administrator, RHCE
GrowZone OnLine (a project of) GrowZone Development Network
POBox 475 Toowoomba Oueensland Australia 4350 Ph: 07 4637 8322
-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list