Bash: manipulating with strings (percent sign) -


what percent sign mean in bash when manipulating strings? example, ${0%/*} mean?

if use @fedorqui's resource, you'll see going strip shortest match of /* end of first positional argument. example:

example_foo(){     echo ${1%/*} }  example_foo path/to/directory/sub_directory # => path/to/directory 

in example used second positional argument since first name of function.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -