Michael Alipio wrote:
> I have a folder named "myfolder"
> Inside "myfolder", I have several files named "ft1, ft2, ft3, ft4".
>
> I need to create symbolic links to all of those files into my current working
> directory.
>
> I tried creating a shell script:
>
> #!/bin/sh
> for i in /myfolder/ft* ; do ln -s ${i} ./; done
>
> But what it did was to create a symbolic link "ft*" pointing to
> /myfolder/ft*...
>
> #ls
>
> 0 lrwxrwxrwx 1 root root 9 2007-01-03 15:55 ft* -> /myfolder/ft*
>
> When all I wanted was to have:
>
> #ls
> 0 lrwxrwxrwx 1 root root 8 2007-01-03 15:58 ft1 -> myfolder/ft1
> 0 lrwxrwxrwx 1 root root 8 2007-01-03 15:58 ft2 -> myfolder/ft2
> 0 lrwxrwxrwx 1 root root 8 2007-01-03 15:58 ft3 -> myfolder/ft3
>
>
> Do you know a quick perl script to accomplish this thing.
perl -MFile::Basename -e'symlink $_, basename $_ for </myfolder/ft*>'
John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/