Skip to content

Instantly share code, notes, and snippets.

@gerhard
Created May 17, 2012 23:14
Show Gist options
  • Select an option

  • Save gerhard/2722208 to your computer and use it in GitHub Desktop.

Select an option

Save gerhard/2722208 to your computer and use it in GitHub Desktop.
bash dry-run mode
init_app_remotely() {
ssh $APP_USER@$SERVER "ls"
}
run() {
__run 'init_app_remotely' "Initializing"
}
__run() {
case "${MODE}" in
(dry-run)
printf '%q' $(declare -f $1)
;;
esac
}
@gerhard

gerhard commented May 17, 2012

Copy link
Copy Markdown
Author

So currently I'm getting:

init_app_remotely\(\)\{ssh\$APP_USER@\$SERVER\"ls\"\}

I'm after:

init_app_remotely\(\)\{sshtest@localhost\"ls\"\}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment