Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to write a small zsh (bash compatible) script to take each file in ~/.oh-my-zsh/links directory and creates a hard link for it in ~. I am not sure how to do this. Would this be correct?

pushd .; 
cd ~/.oh-my-zsh/links; 
ln * ~/*;
popd;

Thanks.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

No that is not correct. You should run this:

pushd .; 
cd ~/.oh-my-zsh/links; 
ln * ~;
popd;

To create a hard link of every file in ~/.oh-my-zsh/links in ~.

share|improve this answer
1  
+1 or do the work in HOME: cd && ln .oh-my-zsh/links/* . && cd - –  glenn jackman Aug 11 '12 at 2:05
1  
Or indeed just ln ~/.oh-my-zsh/links/* ~ –  Daniel Andersson Aug 11 '12 at 12:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.