1

I am trying to used pushd, popd and dirs in SUSE Linux but I am getting

-ksh: pushd: not found 

while I try to check pushd

 which pushd
which: no pushd in (/usr/bin:/bin:/usr/sbin:/sbin)

I am getting there is not pushd.

5

ksh does not have pushd, popd as built-in. But it has an implementation for you.

Try:

. /usr/share/ksh/functions/pushd

or:

. /usr/share/ksh/functions/popd

Then you can use pushd and popd.

To make it permanent, you can source those files directly in your .kshrc or add them to FPATH environment variable.

  • 1
    Paths containing shell functions you might want to use on a regular basis like this can be added to the value of the $FPATH environment variable which gets them sourced and run automatically when called. – mikeserv Jan 5 '15 at 4:08
  • I don't have access to use /ush/share/ksh/ path. I have to implement it. – Amrit Dhungana Jan 5 '15 at 5:21
  • @AmritdeepDhungana Check if it’s in /usr/share/ksh/fun/? – kyrias Jan 5 '15 at 14:02
  • FWIW, the next official release of ksh93 may well have these two functions enabled as external functions by default, judging from what I've seen in the discussions amongst the devs. – Kusalananda Oct 12 '18 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.