Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You could quite easily write a script that does this:

    #!/bin/sh
    cd $1
    shift
    exec "$@"
It's a shame "in" is a reserved word, because that'd be a good name for it. Maybe "cde" for "cd-exec":

    tar c files | ssh dest cde /some/dir tar x


Mine is called cdx and includes 'env' functionality and a bit more. (https://github.com/apk/c-utils/blob/master/aenv.c)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: