Security 更正shell脚本漏洞
对于此脚本中的明显漏洞,您可以进行哪些简单的修复Security 更正shell脚本漏洞,security,shell,scripting,Security,Shell,Scripting,对于此脚本中的明显漏洞,您可以进行哪些简单的修复 #!/bin/tcsh # foreachfile command # a shell script to apply command to each file in the current directory set ListOfFiles = `ls` set Count = 1 set ListLength = $#ListOfFiles while ($Count <= $ListLength) $argv $Li
#!/bin/tcsh
# foreachfile command
# a shell script to apply command to each file in the current directory
set ListOfFiles = `ls`
set Count = 1
set ListLength = $#ListOfFiles
while ($Count <= $ListLength)
$argv $ListOfFiles[$Count]
@ Count = $Count + 1
end
#/垃圾箱/垃圾箱
#foreachfile命令
#用于将命令应用于当前目录中的每个文件的shell脚本
set ListOfFiles=`ls`
设置计数=1
设置ListLength=$#ListOfFiles
而($Count)!/bin/tcsh
#foreachfile命令如果命令理解,您可能还希望在“$f”
之前插入--
。我回滚了您的编辑,因为它们使问题毫无意义。
#!/bin/tcsh
# foreachfile command <<<< You gave away the ending!
# a shell script to apply command to each file in the current directory
foreach f (*)
"$argv" "$f"
end