Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Here's a solution for bash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Here's a solution for bash
Authored by: lukemelia on Aug 17, '05 12:11:36AM
Took me a little fidgeting, but I figured out how to adapt this to work under bash. I added the following to my .bash_profile file:
 
SSH_CLIENT_ADDRESS=`echo $SSH_CONNECTION | cut -f1 -d" "`
export SSH_CLIENT_ADDRESS

SSH_HOST_ADDRESS=`echo $SSH_CONNECTION | cut -f3 -d" "`
export SSH_HOST_ADDRESS

bbedit() {
	ssh lmelia@$SSH_CLIENT_ADDRESS bbedit \"sftp://$USER@$SSH_HOST_ADDRESS/$PWD/"$@"\"
}
Thanks for the hint! -Luke

[ Reply to This | # ]
Here's a solution for bash
Authored by: geordie on Mar 04, '11 06:32:47PM
I prefer to be able to edit files that are not just in my current path. Therefore I get the absolute path to the file instead of using: that way I can do things like "bbedit /etc/httpd/httpd.conf"
bbedit() {
FILEPATH=$(readlink -f "$@")
ssh user@$SSH_CLIENT_ADDRESS bbedit \"sftp:$USER@$SSH_HOST_ADDRESS/"${FILEPATH}"\"
}


[ Reply to This | # ]