I just learned about aliases in bash. I created one like so:
alias="cd $directory"
where $directory
is from use input. In another shell script, I can launch a subshell like so:
( bash )
which brings me to the subshell, where, if I run cd
, I go to the alias, cd $directory
. This is great and it seems to be working as expected.
What I'm looking for is for when the subshell is launched, the cd happens automatically, so I tried:
( bash | cd )
thinking it would launch the subshell and cd to the user-entered $directory
but it's not working. How can I go about getting this to work? I also tried ( bash -c cd)
to no avail.
Thanks.