tags:

views:

62

answers:

2

I have a list of dotFiles at my workarea. For example, .bashrc and .vimrc.

I want to make a symlinks from them to my Home such that their names are the same as in my workarea -folder.

My attempt in pseudo-code

ln workarea/.[a-zA-Z] ~/.*

The problem is to have a bijection from [a-zA-Z] to the files which occur in my Home.

How can you make symlinks with the target files of same name as the original files?

+2  A: 

'man ln' says:

ln [OPTION]... TARGET... DIRECTORY (3rd form)

So you need to do something like:

$ ln -s workarea/.* ~/

Eduard - Gabriel Munteanu
+1  A: 

The possible uses of ln to create symbolic link(s) are:

ln -s <source-file> [<target-file]>
ln -s <source-file> ... <target-dir>

When you type

ln -s workarea/.[a-zA-Z]* ~/.*

(I think you were missing a *) the shell will expand out workarea/.[a-zA-Z] and ~/.*, so (presuming that the your HOME directory contains the files .abc and .def) you would end up with

ln -s workarea/.bash_profile workarea/.bashrc ~/.abc ~/.def

which fits neither usage of ln.

To use the second usage of ln, you would use:

ln -s workarea/.[a-zA-Z]* ~/.
Beano