I have a couple of scripts for configuring new computers. I have a section dedicated to osx, where I create specific osx stuff. I wanted to change the default location for screenshots,but first I need to create the required folder. However, when I try to create the folder at ~/Documents/screenshots
I get a variety of errors:
- If I just use mkdir, then it tells me that the file already exists
- If I add the
-p
option then I get no error, but nothing happens, the file does not get created
I tried the same code on the console directly with identical results. Here is a small part of the code. The get boolean response is just a small function that returs true or false depending if the user types Yes or No
#!/bin/bash
screenshotsFolder="~/Documents/screenshots"
if get_boolean_response "Create a folder for the screenshots at $screenshotsFolder?"; then
mkdir "$screenshotsFolder"
fi
I tried changing the name to a random one, but I get exactly the same results. Any advice?