分类: Java
2011-06-11 18:38:18
#!/usr/bin/sh
clspath="bootstrap.jar"
for k in *.jar
do
clspath=$clspath:$PWD/$k
echo "current jar is $k."
done
printf "classpath is %s" $clspath
@echo off
set clspath=bootstrap.jar
for %%j in (*.jar) do (
set clspath=%clspath%;%cd%\%%j
echo current jar is %%j.
)
echo classpath is %clspath%
@echo off
set clspath=bootstrap.jar
setlocal enabledelayedexpansion
for %%j in (*.jar) do (
set clspath=!clspath!;%cd%\%%j
echo current jar is %%j.
)
echo classpath is %clspath%
endlocal
对比一下,可以发现:
虽然目的达到了,还是要鄙视微软的dos batch,实在很弱,不知Powershell怎样。
参考资料: