-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# back # back from cdm and upm # r2017-02-01 fr2017-02-01 | ||
# by Valerio Capello - http://labs.geody.com/ - GPL | ||
# alias back=". PATH/back.sh" | ||
if [ "$MPWD" == "" ]; then LIMIT=0; fi | ||
LIMIT="$1" | ||
if [ "$LIMIT" == "" ]; then LIMIT=1; fi | ||
P="$MPWD" | ||
# echo -n "cd from $P " | ||
for ((i=1; i <= LIMIT; i++)) | ||
do | ||
P="${P%/..}" | ||
done | ||
# echo "to $P" | ||
cd "$P" | ||
export MPWD="$P" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
# cdm # change directory (and back) # r2017-02-01 fr2017-02-01 | ||
# by Valerio Capello - http://labs.geody.com/ - GPL | ||
# alias cdm=". PATH/cdm.sh" | ||
# echo "cd from $P to $1" | ||
export MPWD="$PWD" | ||
cd "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
# dirm # memorize directory (to get back) # r2019-09-21 fr2017-02-01 | ||
# by Valerio Capello - http://labs.geody.com/ - GPL | ||
# alias dirm=". PATH/dirm.sh" | ||
# echo "directory to remember: $1" | ||
if [ -z "$1" ]; then | ||
export MPWD="$PWD" | ||
else | ||
export MPWD="$1" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# ldirm # list memorized directory # r2019-09-21 fr2019-09-21 | ||
# by Valerio Capello - http://labs.geody.com/ - GPL | ||
# alias ldirm=". PATH/ldirm.sh" | ||
if [ "$MPWD" ]; then | ||
ls -laF --group-directories-first --color=auto "$MPWD" | ||
else | ||
ls -laF --group-directories-first --color=auto | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# showdirm # echo memorized directory # r2019-09-21 fr2019-09-21 | ||
# by Valerio Capello - http://labs.geody.com/ - GPL | ||
# alias showdirm=". PATH/showdirm.sh" | ||
if [ "$MPWD" ]; then | ||
echo "$MPWD" | ||
else | ||
echo "" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# up # up one directory # r2017-02-01 fr2017-02-01 | ||
# by Valerio Capello - http://labs.geody.com/ - GPL | ||
# alias up=". PATH/up.sh" | ||
LIMIT="$1" | ||
if [ "$LIMIT" == "" ]; then LIMIT=1; fi | ||
if [ "$LIMIT" -lt 0 ]; then LIMIT=0; fi | ||
P="$PWD" | ||
if [ "$P" == "/" ]; then LIMIT=0; fi | ||
# echo -n "cd from $P " | ||
for ((i=1; i <= LIMIT; i++)) | ||
do | ||
P=`echo -n "$P" | rev | cut -d "/" -f2- | rev` | ||
# P="$P/.." # alternative method | ||
done | ||
if [ "$P" == "" ]; then P="/"; fi | ||
# echo "to $P" | ||
cd "$P" | ||
# export MPWD="$P" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# upm # up one directory (and back) # r2017-02-01 fr2017-02-01 | ||
# by Valerio Capello - http://labs.geody.com/ - GPL | ||
# alias upm=". PATH/upm.sh" | ||
LIMIT="$1" | ||
if [ "$LIMIT" == "" ]; then LIMIT=1; fi | ||
if [ "$LIMIT" -lt 0 ]; then LIMIT=0; fi | ||
P="$PWD" | ||
if [ "$P" == "/" ]; then LIMIT=0; fi | ||
# echo -n "cd from $P " | ||
for ((i=1; i <= LIMIT; i++)) | ||
do | ||
# P=`echo -n "$P" | rev | cut -d "/" -f2- | rev` # this won't work with back | ||
P="$P/.." | ||
done | ||
if [ "$P" == "" ]; then P="/"; fi | ||
# echo "to $P" | ||
cd "$P" | ||
export MPWD="$P" |