Home > Questions

How to correct batch file error in Mac command?

I am new to using commands, when I tried to use Shell script to create the batch file on my Mac, the process fails with an error sign, how to solve it, please help, thanks a lot.

Best Answered by

iBoysoft author Yuri Zhang

Yuri Zhang

Answered on Tuesday, December 3, 2024

According to questioner's description, you just need to use the right script, please do as follows:

1. Open a text editor like TextEdit or VSCode on your Mac.

2. Copy the following script into the text editor:

#!/bin/bash
# workflow chapter 2 - wfsetupsingle.sh jsl 2008-05-11
# directory structure for single person

# Get current date in YYYY-MM-DD format
CDATE=$(date +"%Y-%m-%d")

mkdir "- History/${CDATE} project directory created"
mkdir "- Hold then delete/- Delete when space is needed"
mkdir "- Pre posted/- Files being prepared to post"
mkdir "- To clean/- Files to be cleaned"
mkdir "- Versions/- Waypoint versions to keep/"
mkdir "Administration"
mkdir "Documentation"
mkdir "Posted/- Files should never be changed"
mkdir "Posted/- Datasets/Source"
mkdir "Posted/- Datasets/Derived"
mkdir "Posted- Text"
mkdir "Resources"
mkdir "Work/Text"
mkdir "Work/- To do"

3. Save the file with a meaningful name and the extension .sh, like create_folders.sh.

4. Open Terminal and navigate to the folder where you saved create_folders.sh.

5. Run the command chmod +x create_folders.sh and press Enter.

Now, it will create the directory structure as specified in the script. If there are further questions, please seek for professional help.

You also can refer to How to Rename a File or Multiple Files in macOS Terminal?

 

People Also Ask

Read More Questions

Read More Advice From iBoysoft's Computer Experts

macos sonoma vmware

[Guide]Comment installer macOS Sonoma sur VMware sur Windows

Si vous souhaitez essayer macOS Sonoma sur un PC Windows, vous pouvez le faire en utilisant la machine virtuelle VMware Workstation. Voici un tutoriel complet pour vous aider à installer macOS Sonoma sur VMware sur Windows.

comment désinstaller la version bêta de macOS Sonoma

Comment désinstaller macOS Sonoma Beta sans perdre de données

Cet article est un tutoriel complet sur la façon de désinstaller la version bêta macOS Sonoma sur un Mac. Vous pouvez restaurer votre Mac à la dernière version publique de macOS ou à une version antérieure sans perdre de données.

Wie man nur Fotos von Mac löscht, aber nicht von iCloud

Wie lösche ich Fotos nur auf dem Mac/MacBook, aber nicht auf iCloud

Folgen Sie diesem Beitrag, um zu erfahren, wie Sie Fotos nur von Ihrem Mac löschen können, aber nicht von iCloud. Löschen Sie Fotos von Ihrem Mac, während Sie sie in iCloud behalten.