I have a simple script that echos a line into my fstab file. It's probably not safe but I just using it for testing. Anyway, the second line works but for some reason the third always says permission denied even though I know it is running as root. Any ideas?
Code:
#!/bin/bash
echo "*******" | sudo -S mkdir /mnt/publicshare
sudo echo "//macx/swu /mnt/publicshare smbfs user,rw,noauto,username=swu" >> /etc/fstab