Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Bash脚本转换为Perl/VBS/任何其他与windows兼容的语言_Perl_Bash_Powershell_Vbscript_Batch File - Fatal编程技术网

将Bash脚本转换为Perl/VBS/任何其他与windows兼容的语言

将Bash脚本转换为Perl/VBS/任何其他与windows兼容的语言,perl,bash,powershell,vbscript,batch-file,Perl,Bash,Powershell,Vbscript,Batch File,我得到了一个bash脚本,用于将文件从沙箱传输到主机。 sandboxdirectory中的文件只有在较年轻时才会被传输,这意味着它们以前曾被触摸过。不幸的是,cygwin在windows下造成了麻烦,所以我需要另一种语言的脚本,或者我需要在windows下像cygwin一样工作的脚本。 这个脚本只有大约20行,但是我不知道如何将它转换成另一种语言,特别是像touch、make、gcc、getopts、set-e这样的命令 如果有人发现这很容易做到,并将其转化,我会很高兴: # EXITING

我得到了一个bash脚本,用于将文件从沙箱传输到主机。 sandboxdirectory中的文件只有在较年轻时才会被传输,这意味着它们以前曾被触摸过。不幸的是,cygwin在windows下造成了麻烦,所以我需要另一种语言的脚本,或者我需要在windows下像cygwin一样工作的脚本。 这个脚本只有大约20行,但是我不知道如何将它转换成另一种语言,特别是像touch、make、gcc、getopts、set-e这样的命令 如果有人发现这很容易做到,并将其转化,我会很高兴:

# EXITING SCRIPT IF ERROR OCCURS
set -e

FORCE=false
JUSTPRINT=

# if parameter -f is given, force to transfer all files(no matter if new or not)
# if -n is given checking files
while getopts fn opt 2>/dev/null
do
case $opt in
f) FORCE=true ;;
n) JUSTPRINT="-n" ;;
?) ;;
esac
done

# deleting parsed options from command line
shift `expr $OPTIND - 1`


# refresh files that came with -f
if [ \( $FORCE = true \) -a \( $# -gt 0 \) ]
then
touch -c $@
fi

# Targets (dummy files for timestamp)
TARGETS=`for filename
     do
       if [ -f $filename ]
       then
         echo "../transport_dummies/\`basename $filename\`.dum"
       else
         echo "$filename"
       fi
     done`

# call script directory
echo $0
cd `dirname $0`

# creating sysfilterL.exe
if [ ! -f sysfilterL ]
then
echo "sysfilterL is created."
gcc sysfilter.c -o sysfilterL
fi

# Call Transport-Makefile with target
if [ $# -gt 0 ]
then
make --warn-undefined-variables $JUSTPRINT -f transportDE.mk reset $TARGETS
send_queueed
else
make --warn-undefined-variables $JUSTPRINT -f transportDE.mk
fi

您可以将shell脚本转换为批处理文件,此处将介绍:


这里还有一个bash和batch中相应命令的列表:

为什么每个人都给我坏名声而不是帮助我?因为这不是一个为我做事的网站。你需要问更具体、更负责的问题。阅读有Windows bash端口,例如cygwin、msys。是的,有很多人可以。例如,你可以。阅读链接页面。理解它。转换你能转换的。然后回到这里,问一些关于你无法理解的命令的具体问题……或者雇佣某人为你工作。