I'm trying to use external cd (/usr/bin/cd) to jump to parent directory /usr/bin/cd .. but it doesn't work (no error message, current directory remains as was). I know this is a builtin bash command and this whole operation is pointless but it's part of school assignment, any ideas how to achieve it?
Asked
Active
Viewed 118 times
0
Paulo Tomé
- 3,782
Janek
- 1
1 Answers
-2
I found the answer myself. Proper usage is:
. /usr/bin/cd ..
Janek
- 1
-
2that only works if
/usr/bin/cdis implemented as a shell script. It doesn't have to be, though that would be a trivial implementation. – ilkkachu Mar 30 '20 at 20:49
cdare listed in the answers to this question: What is the point of thecdexternal command?. They are extremely specific. – Michael Homer Mar 24 '20 at 01:57cdutility in the Single UNIX Specification and are prepared to come back and challenge the premise of the exercise, doco in hand? (-: – JdeBP Mar 24 '20 at 08:38