我有一个.sh脚本
#!/bin/sh
LOOK_FOR="codehaus/xfire/spring"
for i in `find . -name "*jar"`
do
echo "Looking in $i ..."
jar tvf $i | grep $LOOK_FOR > /dev/null
if [ $? == 0 ]
then
echo "==> Found \"$LOOK_FOR\" in $i"
fi
done
有人可以帮助我将其转换为在Windows上运行的.bat脚本。
此致 DH
答案 0 :(得分:0)
@echo off
setlocal enableextensions
set "LOOK_FOR=codehaus/xfire/spring"
for %%a in ("*.jar") do (
echo Looking in %%a
jar tvf "%%a" | find "%LOOK_FOR%" >nul && echo Found in %%a
)
当然假设您在路径中有jar.exe
,当前文件夹包含.jar
个文件(.sh
文件中的相同假设)