Posts Tagged ‘Shell

You can return the exit/return code of the command you just ran in OSX/Linux using this simple command:
1echo $?
This is handy when debugging scripts that rely on shell command return values.

I always used to log-out / log-back-in to shell, to allow changes in my .bash_profile to kick in. I’m guessing this would work in OSX with your .profile file too but I’ve not tested it. Anyways, I discovered you can reload the script on the fly using:
1source ~/.bash_profile

Lots of love going about today! This time, the recipient is SSHFS which allows you to mount a remote filing system onto your local tree over SSH. In a virtual hosting environment (/vhosts/ etc) it’s pure joy to work with.
You’ll need to install SSHFS on the client (the machine you want to mount the remote [...]

This will dump an SQL statement into a file:
1mysql -u username -p database_name -e "SQL_STATEMENT" > file.data

If you want to ignore (skip) files inside a directory with SVN:
1svn pe svn:ignore smarty/templates_c
This will prompt you for a pattern (*.php) via your editor of choice. So you’ll need the EDITOR environment variable set in your ~bash.rc / .profile etc
1EDITOR=vi;  export EDITOR
Update (14/04/09): This only ignores files that are not already version controlled (inside [...]


top