3
A
回答
7
沒有,但是你可以重寫source
命令本身來跟蹤source
「d文件的地方,像這樣:
rename source __real_source
proc source args {
global sourced
lappend sourced $args
uplevel 1 [linsert $args 0 __real_source]
}
更新:擴大有關source
的脆弱性在多納爾的評論命令有如何設置執行軌跡:
proc register_sourced {cmd args} {
global sourced
lappend sourced [lindex $cmd end]
}
trace add execution source leave register_sourced
相關問題
- 1. 找出所有文件'源'給定的TCL文件
- 2. Cleartool命令列出變更集的所有文件部分
- 3. 在tcl的foreach命令讀取文件
- 4. git列出所有可用的命令
- 5. 從TCL文件執行linux命令
- 6. TCL clock命令
- 7. Linux命令行 - 列出所有不可訪問的文件和文件夾
- 8. 命令列出文件夾中的所有文件以及窗口中的子文件夾
- 9. 如何列出卡上所有可用的上下文命令?
- 10. 如何列出資源目錄中的所有文件
- 11. iPhone/iOS:如何列出資源組中的所有文件?
- 12. Cocos2d-x如何列出資源目錄中的所有文件
- 13. 列出文件夾中的所有嵌入式資源
- 14. linux工具列出源文件中的所有功能?
- 15. 腳本在目錄中列出了所有的頭文件(.h文件)所需/命令(遞歸)
- 16. 如何捕獲命令行中的所有命令和輸出?
- 17. 使用文件參數的tcl中的exec命令
- 18. LLDB源命令文件
- 19. 批量命令顯示文件夾中的所有文件
- 20. 爲文件夾中的所有文件執行命令
- 21. 列出與CVS命令行上的標籤關聯的所有文件
- 22. 列出以小寫字母結尾的所有文件的命令是什麼?
- 23. 大小命令輸出中所有列的解釋?
- 24. 列出所有文件夾中的所有文件在一個列表中
- 25. 列出Android中的所有Mp3文件
- 26. 列出倉庫中的所有文件?
- 27. 列出文件中的所有#區域
- 28. 列出Google Drive中的所有文件
- 29. 列出URL中的所有文件android
- 30. 列出目錄中的所有文件
不應該在'uplevel'命令中執行'__real_source'嗎? – bmk 2012-04-10 10:33:20
使用8.6,我會使用:'proc source args {lappend :: sourced [lindex $ args end]; tailcall __real_source {*} $ args}' – 2012-04-10 10:48:36
謝謝,@bmk,我在輸入時忽略了這個 – kostix 2012-04-10 10:58:00