Reputation: 1126
I am trying to create a script which would create symlinks from a folder 1 level up and i am using as follows:
symlinks.sh
ln -s '../config/environments' > 'environments'
ln -s '../config/init' > 'init'
environments is a folder and init is a file.
and when i go to the folder where symlinks.sh is and execute ./symlinks.sh, its creating 4 files which are:
I also tried:
ln -s '../config/environments' .
ln -s '../config/init' .
but with this one, init is created in the current folder and environments goes to folder ../config/environments/environments
Can someone help me please?
Upvotes: 1
Views: 2023
Reputation: 178
It's because you are redirecting the output ">". You don't need to do that with ln, it will automatically create a symlink in the current directory if you use:
ln -s "../config/environments"
ln -s "../config/init"
Upvotes: 3