zoukankan      html  css  js  c++  java
  • bincp复制命名脚本

    #!/bin/bash
    declare -i DebugLevel=0
    Target=/mnt/sysroot
    [ -d $Target ] || mkdir $Target &>/dev/null
    read -p "A command:" Command
    while [ $Command != 'q' -a $Command != 'Q' ] ; do
    Command=`which $Command | grep -v "^alias" | grep -o "[^[:space:]]*"`
    [ $DebugLevel -eq 1 ] && echo $Command

    ComDir=${Command%/*}
    [ $DebugLevel -eq 1 ] && echo $ComDir
    [ -d ${Target}${ComDir} ] || mkdir -p ${Target}${ComDir}
    [ ! -f ${Target}${Command} ] && cp $Command ${Target}${Command} && echo "Copy $Command to $Target finished."
    for Lib in `ldd $Command | grep -o "[^[:space:]]*/lib[^[:space:]]*"` ; do
    LibDir=${Lib%/*}
    [ $DebugLevel -eq 1 ] && echo $LibDir

    [ -d ${Target}S{LibDir} ] || mkdir -p ${Target}${LibDir}
    [ ! -f ${Target}${Lib} ] && cp $Lib ${Target}${Lib} && echo "Copy $Lib to $Target finished."
    done
    read -p "A command: " Command
    done

  • 相关阅读:
    1010考试T1
    P5631 最小mex生成树 分治 并查集
    P4366 [Code+#4]最短路 建图 最短路
    P1654 OSU! 期望概率DP
    7.26集训
    7.25集训
    7.23集训
    7.22集训
    7.21test
    7.12test
  • 原文地址:https://www.cnblogs.com/bpsanshao/p/11283373.html
Copyright © 2011-2022 走看看