Autosave: 2023-01-21 12:18:17
This commit is contained in:
parent
966961c6d5
commit
9db2cd0c8a
3 changed files with 28 additions and 3 deletions
|
@ -1,9 +1,12 @@
|
|||
#!/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"
|
||||
SPACE_TO_UNDERSCORE="${HOME}/repos/bash_scripts/space_to_underscore_filename.sh"
|
||||
# It is aliased to `cs-update` in .zshrc
|
||||
|
||||
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"
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
# This script returns a random topic for me to revise
|
||||
|
||||
# It is aliased to cs-revise in .zshrc
|
||||
|
||||
# Choose source directories...
|
||||
DIRS_TO_PARSE="../Computer_Architecture ../Databases ../Electronics_and_Hardware ../Operating_Systems ../Programming_Languages/Shell ../Logic"
|
||||
|
||||
|
|
20
_scripts/space_to_underscore_filename.sh
Executable file
20
_scripts/space_to_underscore_filename.sh
Executable 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
|
Loading…
Add table
Reference in a new issue