Created
July 30, 2014 07:10
-
-
Save Tschrock/99b320640a1a415e15c9 to your computer and use it in GitHub Desktop.
Some shell scripts to make my life easier.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -w $1 ]]; then | |
nano $@ | |
else | |
sudo nano $@ | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -f $1 ]]; then | |
snano $@ | |
else | |
if [[ -w $(basename $1) ]]; then | |
xnano $@ | |
else | |
sudo xnano $@ | |
fi | |
fi | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ! -f $1 ]]; then | |
touch $1 && chmod +x $1 && echo "#!/bin/bash" > $1 && nano $1 | |
else | |
nano $1 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment