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

You can also use parentheses to create a scope for the current directory and environment variables (the shell forks a subprocess to run parenthesized commands).

    (cd /usr/ports/*/$PACKAGE ; sudo make install clean)
See http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu...


In your example, however, the failure of `make install clean` will put you back in the original directory and not in the port's directory where you probably want to be to debug the failure. My original example keeps you in the port's directory in the event of installation failure.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: