Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 754 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 754 Bytes

PATH HANDLING

Demonstrates ways of manipulating paths

Demonstrates

Demonstrates techniques for discovering paths

# if not passed anything it will use $0 as the path
./paths_testing.sh

# test a given path
./paths_testing.sh --test=./paths_testing.sh

# home
./paths_testing.sh --test=$(echo ~)

# longer path
./paths_testing.sh --test=$(pwd)/../../sources/audiobooks/christmas_short_works_2008_0812_64kb_mp3/french_lapaysanne_arene_di_64kb.mp3

Now copy the value of SCRIPT_FULL_PATH from output into paste buffer. This will run the script from the root folder.

cd /
$(pbpaste)
popd

Resources

  • Bash Parameter Expansion here