Set Mac wallpaper via CLI

[cc lang=”bash”]osascript -e ‘tell application “System Events” to set picture of (reference to current desktop) to “/Users/dsadmin/Desktop/nettools/.background_10134.jpg”‘[/cc]

or if you need variables

[cc]osascript -e “tell application \”System Events\” to set picture of (reference to current desktop) to \”$HOME/Desktop/nettools/.background_$swver.jpg\””[/cc]

escaping the quotes in the expression