I wrote a script using softlinks with wildcards and found out that it causes ambiguity.
I found an inelegant workaround but still don't understand how the ambiguity is caused.
#ln -s ../../FtE/lib/* Lib/. #ln -s ../../FtE/lib/.lib Lib/.
for LINKS in `ls ../FtE/lib`
do
ln -s ../../FtE/lib/$LINKS Lib/.
done
popd >/dev/null
.......
The green codes shows what worked. The brown code shows those that failed.
In the first green line, I used a wildcard () with 'ln -s' and it is accepted.
The next time I tried this, it fails so I have to use a 'for' loop.
Can anyone clarify what the ambiguity is here?
Unfortunately no messages.
Probably because the wildcard (*) symbol was used, the softlinks were not created silently (no errors).
I found out from a different post (which was posted sometime ago) that it probably was caused by ambiguity.
so I'm wondering if someone could elaborate on this matter.
Sorry, my bad.
There was a wrong link created...
In my directory, instead of creating links to all the files, it created a file called:
"" linking to "../../FtE/lib/" OR ".lib" linking to "../../FtE/lib/.lib"
I that seems normal when there are no files that match the first parameter, so you should probably test for their existence before attemping to symlink.
Personally I'd stick with the for loop since it's safer and more portable.
I see.
Seems like I might have made a mistake in when popping/pushing directories around.
Well, it's a bit too late to backtrack & pinpoint now. I might as well stick to full directory paths & use 'for' loops to be safer.
Thanks!