I have a syntax issue I am hoping someone can help me with...
I am trying to write to $HOME/fubar upon user login with a BASH script ran as a policy within JAMF.
I was thinking that $3 would return a username of the user logging in (lets say the local user is smith.1 who has just logged in, so $3=smith.1 and his homedir is /Users/smith.1/).
Now if I say, ```
touch ~$3/jamf.txt
I would then expect in the root of smith.1's homedir to see jamf.txt, aka /Users/smith.1/jamf.txt
Alas, this is not working and it seems that while *3=smith.1* an ```
ls ~smith.1
returns "No such file or directory" within a debugging phase of my script and thus the rest of the script fails.
My question is, how does one create a script within JAMF that understands who just logged in and writes a file to that user's homedir and what then does $3 do for me?
To borrow another post's code, for example sake, why does the following fail?
defaults write ~$3/Library/Preferences/com.apple.screensaver.plist askForPassword -int 1