Cannot efficiently create symlinks to target files with the same names

I have a dotFiles list in my work arena. For example .bashrc and .vimrc.

I want to make symbolic links to them in my Home so that their names are the same as in my workarea folder.

My attempt at pseudocode

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

      

The problem is to have a bijection from [a-zA-Z] to files that are happening in my House.

How can you create symbolic links to target files with the same name as the source files?

0


a source to share


2 answers


'man ln' says:

ln [OPTION] ... TARGET ... REFERENCE INFORMATION (3rd form)



So, you need to do something like:

$ln -s workarea/.* ~/

+2


a source


Possible uses ln

for creating symbolic links:

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

      

When typing

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

      

(I think you are missing *

) the shell will expand workarea/.[a-zA-Z]

and ~/.*

so (assuming your HOME directory contains files .abc

and .def

) you get



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

      

which is not suitable for any use ln

.

To use the second use ln

, you must use:

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

      

+1


a source







All Articles