Commit 520c7b3f authored by Hermann Mayer's avatar Hermann Mayer
Browse files

BashRC: Improved the mpx util.

parent 7d948144
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -247,7 +247,22 @@ function mpx()
    txtcyn='\e[0;36m' # Cyan
    txtrst='\e[0m'    # Text Reset

    find */ -maxdepth 0 | while read file; do
    paths="*/"
    cmd="${@}"

    if [ $# -gt 1 ]; then
        paths=''
        cmd="${@: -1}"
        for path in "${@:1:$(($#-1))}"; do
            paths=$(echo "${paths} ${path}")
        done
    fi

    if [ '' = "${cmd}" ]; then
        cmd='ls -lisa'
    fi

    find ${paths} -maxdepth 0 | while read file; do

        echo
        echo
@@ -257,7 +272,7 @@ function mpx()
        echo -e "${txtrst}"

        cd "${file}"
        eval "${@}"
        eval "${cmd}"
        cd "${CWD}"
    done