Tuesday, December 15, 2020

Merubah directory dalam script

 # tambahan  

OLDPWD=$(pwd)

cd /opt/[direktory]

function atexit() { cd "$OLDPWD"; }

trap atexit EXIT # go back to where we came from, however we exit

# end of tambahan  


No comments:

Post a Comment