Skip to content

Commit

Permalink
another progress
Browse files Browse the repository at this point in the history
  • Loading branch information
dee-mee committed Apr 2, 2024
1 parent 9ddad0e commit 3e56a4f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions script4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

#this script is about navigatting directory levels
echo ""
LEVEL=$1
echo ""

#initialize CDIR to the current directory
CDIR="."

#loop to move up the directory levels.
for ((i=1;i<=LEVEL;i++)); do
CDIR="../$CDIR"
done


#change to the calculated directory.
cd "$CDIR" || exit

#print the current working directory.
echo "You are in: $PWD"

#start new Bash session
exec /bin/bash

0 comments on commit 3e56a4f

Please sign in to comment.