News for hackers. Stuff that matters.
Re:Show HN: ssh and cd get married by neoteric on Wednesday February 12, 2014 @08:36AM (#7224132)
For what it's worth, this is broken when the target directory contains spaces/wildcard characters, etc. I would suggest you consider using something like the following to generate the command line you pass to ssh:

  printf -v cmd 'cd %q && $SHELL -l' "$target_dir"
Also, dropping the ':' and just having an additional argument would make your life a bit simpler. What's with the array assignment just to invoke the command? Seems a bit unnecessary. The microoptimizer in me tells me you should use 'exec' as well :).

There are no comments on this comment yet.