Shell #*/ 和 %/*

#!/bin/bash

i="this/is/a/path.config"

name=${i#*/}
path=${i%/*}

echo $name
echo $path



is/a/path.config

this/is/a

  

原文地址:https://www.cnblogs.com/TMatrix52/p/7418269.html