重囗另类BBWSeⅹHD,av狼论坛,精品一卡2卡三卡4卡乱码理论,体育生gv老师浪小辉3p警察

Shell 調(diào)試 -電腦資料

電腦資料 時間:2019-01-01 我要投稿
【www.ipr-jzsc.com - 電腦資料】

    一、簡介

    本文全面系統(tǒng)地介紹了shell腳本調(diào)試技術(shù),包括使用echo, tee, trap等命令輸出關(guān)鍵信息,跟蹤變量的值,在腳本中植入調(diào)試鉤子,使用“-n”選項進行shell腳本的語法檢查, 使用“-x”選項實現(xiàn)shell腳本逐條語句的跟蹤,巧妙地利用shell的內(nèi)置變量增強“-x”選項的輸出信息等,

Shell 調(diào)試

    二、shell調(diào)試選項

    1)只讀取shell腳本,不實際執(zhí)行,用于檢測shell腳本是否存在語法錯誤

    -n

    2)使shell解釋器從一個字符串中讀取并執(zhí)行shell指令,用于臨時測試小段腳本

    -c "string"

    3)進入跟蹤方式,使shell在執(zhí)行腳本的過程中把它實際執(zhí)行的每一個命令行顯示出來,并且在行首顯示一個"+"號

    -x

    示例:

   

$ sh –x exp2.sh+ trap 'echo "before execute line:$LINENO, a=$a,b=$b,c=$c"' DEBUG++ echo 'before execute line:3, a=,b=,c='before execute line:3, a=,b=,c=+ a=1++ echo 'before execute line:4, a=1,b=,c='before execute line:4, a=1,b=,c=+ '[' 1 -eq 1 ']'++ echo 'before execute line:6, a=1,b=,c='before execute line:6, a=1,b=,c=+ b=2++ echo 'before execute line:10, a=1,b=2,c='before execute line:10, a=1,b=2,c=+ c=3++ echo 'before execute line:11, a=1,b=2,c=3'before execute line:11, a=1,b=2,c=3+ echo endend

    三、shell調(diào)試工具:bashdb

    http://bashdb.sourceforge.net/

最新文章
主站蜘蛛池模板: 屏东市| 宣恩县| 鲁山县| 崇左市| 全南县| 察隅县| 报价| 双辽市| 营山县| 镇康县| 台中市| 宁国市| 安徽省| 九江市| 台州市| 万载县| 阜阳市| 南城县| 阳曲县| 读书| 荔波县| 汉源县| 湘潭县| 江安县| 鄄城县| 嘉兴市| 河曲县| 贵南县| 青川县| 武夷山市| 绍兴市| 瑞丽市| 沅陵县| 萝北县| 汽车| 通山县| 五台县| 隆回县| 阿拉善右旗| 阿拉善左旗| 大竹县|