Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Creating the scripts directory
- DIR=$HOME"/scripts"
- if [ ! -d "$DIR" ]; then
- mkdir ~/scripts
- fi
- read -p "Script name: " FILE
- echo "Creating script: $FILE!"
- FILEPATH=$DIR"/"$FILE
- touch $FILEPATH
- read -p "command to execute:" EXEC
- echo "using script:"
- echo $EXEC
- echo "#!/bin/sh" > $FILEPATH
- echo $EXEC >> $FILEPATH
- chmod 755 $FILEPATH
- osascript -e 'tell application "System Events" to make login item at end with properties {name: "'$FILE'", path:"'$FILEPATH'", hidden:false}'
Add Comment
Please, Sign In to add comment