How can I create a new user through terminal macOS 10.14

I am trying to write a script to add a user to a computer. These will not be admin accounts and should be staff accounts. I ran the following script and can login to the account but I can’t access any files, create any files, or save any files to the computer.

Ultimately I would like to run this to remove 5 user accounts and all of their information and then create 5 new accounts (this is in a classroom where I have 36 computers) but I am struggling to create a single user correctly with the following script.

Any help would be much appreciated.

#!/bin/bash  USERNAME=per1 FULLNAME="Period 1" PASSWORD="test" SECONDARY_GROUPS="staff"   # ====  if [[ $  UID -ne 0 ]]; then echo "Please run $  0 as root." && exit 1; fi  # Find out the next available user ID MAXID=$  (dscl . -list /Users UniqueID | awk '{print $  2}' | sort -ug | tail -1) USERID=$  ((MAXID+1))  # Create the user account dscl . -create /Users/$  USERNAME dscl . -create /Users/$  USERNAME UserShell /bin/bash dscl . -create /Users/$  USERNAME RealName "$  FULLNAME" dscl . -create /Users/$  USERNAME UniqueID "$  USERID" dscl . -create /Users/$  USERNAME PrimaryGroupID 20 dscl . -create /Users/$  USERNAME NFSHomeDirectory /Users/$  USERNAME  dscl . -passwd /Users/$  USERNAME $  PASSWORD   # Add use to any specified groups for GROUP in $  SECONDARY_GROUPS ; do     dseditgroup -o edit -t user -a $  USERNAME $  GROUP done  # Create the home directory createhomedir -c > /dev/null  echo "Created user #$  USERID: $  USERNAME ($  FULLNAME)" 

In macOS 10.14 (Mojave), can Finder remember previously opened tabs like Safari pin tabs?

First of all, I am not asking to re-open Finder tabs on OS reboot, we all know it works.

I am asking for a solution when I accidentally clicked on the red-cross (aka close window button) on Finder window, it cause Finder to lose all currently opened tabs.

I know this is the expected behavior, but can I change it somehow? I have come to rely on it in macOS 10.12-10.13 (Sierra and High Sierra), when Finder window always remember previously opened tabs even if you close it yourself.

Some say the behavior in 10.12/10.13 is a bug, other argues it was working in Mavericks 10.9, but was broken by Apple in Yosemite 10.10, and later fixed then re-break. Both could be true. But is there a solution to get this behavior back?

The best I could find is a AppleScript that open tabs, but it doesn’t really restore tabs as it simply doesn’t have the information to restore a previously closed window.

Is there a solution out there I am not aware of?

10.14: Only display full path in a Finder window’s title bar and not in its tabs?

I just finally updated to Mojave, and there’s a new behavior in the Finder for those of us that set the hidden preference _FXShowPosixPathInTitle to true.

Previously when using that setting in 10.13, tabs in Finder windows would only display the name of their folder. Now they display the full path of their folder, just like the title bar.

I have a Finder window with eight tabs in it that I use as part of my daily workflow. Sufficed to say it’s now impossible to tell which tab is for which folder because I can only see the first twelve characters of the path. (i.e. /Users/myusername/ — not very helpful!)

Is there any way of getting the old behavior back? Or perhaps some other solution to this problem?

Reduce or disable DNS cache in 10.13 and 10.14

I’m trying to get a hold of the property list, I’m guessing, that specifies the TTL or the amount of records held of the DNS cache of the system, if is not user/root accessible, then command that edits it, hopefully.

I want to reduce the TTL or eliminate it, my local DNS servers are fast enough for continuous querying

I do not want to flush it, I already know the commands for that, even made a script out of it. It takes like nothing but you still have to sudo -i to become root and go into root’s home folder, where it made the most sense to store it if I’d have to superuser-myself anyway.

Reduce or kill, not flush. 🙂 Thanks!

Will macOS Mojave 10.14 slow down an early 2011 13″ MacBook Pro?

I am currently running OS X El Capitan on my early 2011 13″ MacBook Pro. I am thinking of upgrading to macOS Mojave, but would like to know if it would slow my MacBook Pro because of my specs?

Please see more info on the specs below:

enter image description here

I’m not using an SSD and my current available space is 140GB (total is 320GB), though I always make sure I don’t go below 100GB available space.