stupid linux trick?

Brett G. Monroe bmonroe at u.washington.edu
Tue Sep 21 16:20:17 PDT 1999


How 'bout:

#!/bin/sh

for i in /mnt/cdrom/* ;
do
	ln /mnt/cdrom/$i /mnt/allcd/$i ;
done

for i in /mnt/cdrom2/* ;
do
        ln /mnt/cdrom2/$i /mnt/allcd/$i ;
done

exit

I havn't actually tested this (as I am not blessed with two cdrom drives
but I think it should work.


 )  |o)____               ) Dept. Microbiology		 )
(   |0)re||  |\/|        (  HS K443B     616-4285	(
 )           |  |onroe    ) bmonroe at u.washington.edu	 )

On Tue, 21 Sep 1999, R. David Whitlock wrote:

> OK, I'm trying to do something I thought would be easier than this, but no
> results yet.  Maybe I can get a suggestion here...
> 
> I want to make a directory such that all files in this directory are
> actually just links to other files in other directories, and use this on
> two directories.
> 
> Abstraction aside, what I'm doing is I have two mounted cd-drives in
> /mnt/cdrom and /mnt/cdrom2.  I want to make a combined directory that has
> nothing but symlinks to the files on the two cd drives, ie a /mnt/allcd
> directory.  
> 
> Best solution was a quickie perl script from Eric, but I don't really
> follow the whole regex, and it doesn't work anyway.
> 
> Ideas?  Script is below, gives no errors, I thought maybe there was
> something simpler than this...
> 
> #!/usr/bin/perl
> foreach(`ls -l /mnt/cdrom`, `ls -l /mnt/cdrom2`) {
>   `ln -s $2 /mnt/mp3/$1` if /^l.+ (\S+) \-\> (\S+)$/;
> }
> 
> 
> 
> 
> 
> 
> 



More information about the Linux mailing list