Autosave: 2023-01-21 12:18:17

This commit is contained in:
thomasabishop 2023-01-21 12:18:17 +00:00
parent 966961c6d5
commit 9db2cd0c8a
3 changed files with 28 additions and 3 deletions

View file

@ -1,9 +1,12 @@
#!/bin/bash #!/bin/bash
# This script runs as a cron job in half-hour intervals to automatically commit changes to the remote repository # This script automatically commits/pull changes to the remote repository with a generic commit message.
NOTES_PATH="${HOME}/repos/computer_science" # It is aliased to `cs-update` in .zshrc
SPACE_TO_UNDERSCORE="${HOME}/repos/bash_scripts/space_to_underscore_filename.sh"
NOTES_PATH="/home/thomas/repos/computer_science"
SPACE_TO_UNDERSCORE="/home/thomas/repos/computer_science/_scripts/space_to_underscore_filename.sh"
CLEAN_IMAGE_DIRECTORY="/home/thomas/repos/computer_science/_scripts/clean_image_directory.sh"
cd "$NOTES_PATH" cd "$NOTES_PATH"

View file

@ -2,6 +2,8 @@
# This script returns a random topic for me to revise # This script returns a random topic for me to revise
# It is aliased to cs-revise in .zshrc
# Choose source directories... # Choose source directories...
DIRS_TO_PARSE="../Computer_Architecture ../Databases ../Electronics_and_Hardware ../Operating_Systems ../Programming_Languages/Shell ../Logic" DIRS_TO_PARSE="../Computer_Architecture ../Databases ../Electronics_and_Hardware ../Operating_Systems ../Programming_Languages/Shell ../Logic"

View file

@ -0,0 +1,20 @@
#!/bin/bash
# Convert spaces in file and directory names to underscore
main() {
find . -depth -name '* *' | while read fname; do
new_fname=$(echo $fname | tr " " "_")
if [ -e $new_fname ]; then
echo "File $new_fname already exists. Not replacing $fname"
else
echo "Creating new file $new_fname to replace $fname"
mv "$fname" $new_fname
fi
done
}
# Run and pipe errors and feedback to logfile
&>/dev/null
main