Common Issues
Permissions
Description
You encounter “Permission denied” errors when trying to read, write, or execute files or directories. This typically occurs when you do not own the file or folder, or when the proper group read/write privileges have not been granted.
Steps to Resolve
Determine who owns the file or directory by running:
ls -l /path/to/file
If you are the owner: Restore standard group privileges by running:
ensure_permissions /path/to/fileIf you are not the owner: Ask the file’s owner to run the
ensure_permissionscommand shown above.If the owner is a numeric UID instead of a NetID: Contact CVL Tech for administrator assistance.
End of Line Sequence (CRLF vs LF)
Description
When executing scripts on the server, you receive error messages similar to:
line 1: $':\r': command not found
line 5: syntax error near unexpected token `$'\r''
This error signifies that the file contains Windows-style carriage return line endings (CRLF) instead of Unix-style line endings (LF). This typically happens when code is written or copy-pasted from Windows applications, text editors, or web browsers.
Steps to Resolve
Option A: Using the vi Text Editor (in Terminal)
Open the file in the terminal using
vi’s binary mode:vi -b /path/to/file
Strip the carriage returns (
\r) by typing the following command inviand pressingEnter::%s/\r$//Save the changes and exit by typing
:xand pressingEnter.
Option B: Using the nano Text Editor (in Terminal)
Open the file in the terminal:
nano /path/to/filePress
Ctrl+Oto initiate writing out (saving) the file.At the filename prompt, press
Alt+D(on macOS, pressEscthenD) to toggle the DOS format off. You will see[DOS Format]disappear from the status bar.Press
Enterto confirm saving the file in Unix format.Press
Ctrl+Xto exit.
Option C: Using Visual Studio Code
If you are testing scripts that read from a .csv file and find the terminal output is cut off or flipped, the .csv is likely saved in Windows-style format.
Open the file in Visual Studio Code.
Look at the bottom-right status bar, click on CRLF, and change it to LF.
Save the file.