shell - Terminal scripting in OSX -


i've never created script before , looking tutorial on writing script osx 10.6. there terminal command can show hidden files. it's

defaults write com.apple.finder appleshowallfiles true killall finder 

changing true false hide system files. want make script checks value of appleshowallfiles, , if true, writes false, , if false, writes true.

is done in textedit , saved .sh file? can script double-click runs, or have start terminal , type command execute script? i'm newb, sorry

thanks guys

make file switchhideshow.command following content:

#!/bin/sh  show=`defaults read com.apple.finder appleshowallfiles 2>/dev/null`  if [ "$show" == "true" ];   defaults write com.apple.finder appleshowallfiles false else # here come, if false or empty (the default)   defaults write com.apple.finder appleshowallfiles true fi  killall finder 

then: chmod a+x switchhideshow.command

ready. unfortunately, should close terminal every time run it. also, might want @ this. describes how call shell script show hidden files automator actions.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -