0

I'm working on a script that will create a local user account, and link local account directories to networked account directories. The only directories I would like to be created and linked are the standard directories for a newly created accounts, i.e., Desktop, Documents, Downloads, Pictures, Public, and Videos. So if the network account has other directories, they would be skipped.

Here is the segment of the script written, to test my script over all.

for i in /home/$netAcct/ ; do
  if [ -d "$i" ]; then
    ln -s /home/$netAcct/* /home/$localAcct/
  fi
done
0

You need to do

for i in /home/"$netAcct"/{Desktop,Documents,Downloads,Pictures,Public,Videos}

to look at all the standard subdirectories of netAcct's home directory, and then

    ln -s "$i" /home/"$localAcct"/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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