-2
#! /bin/sh

JBOSS_SERVER=$JBOSS_HOME/server/otcm-server
JBOSS_DEPLOY=$JBOSS_SERVER/deploy
JBOSS_LIB=$JBOSS_SERVER/lib
JBOSS_CONF=$JBOSS_SERVER/conf
JBOSS_WEB=$JBOSS_DEPLOY/ROOT.war

mkdir $1
cp $1.tar $1
cd $1
tar -xvf $1.tar
rm $1.tar
cd ..

cp $1/*.xml $JBOSS_DEPLOY
cp $1/*.ear $JBOSS_DEPLOY
cp $1/*.sar $JBOSS_DEPLOY
cp $1/*.jar $JBOSS_LIB

cp $1/lib/* $JBOSS_LIB

cp $1/conf/* $JBOSS_CONF

rm -rf $JBOSS_SERVER/tmp
rm -rf $JBOSS_SERVER/work

as you can see from the script i need to move the tar to another folder then unzip the content, after that i copy the contents from that tar to their respective folders.

the main part i cant get working is the unzipping part...

8
  • 1
    Why not just use cygwin ? Then you wouldn't need to translate scripts such as this. Go to: cygwin.com
    – Paul R
    Nov 2, 2011 at 14:59
  • @PaulR i am actually using cygwin to run this script. but all my work is done in windows and i only need that script to move files around so i was hoping to get some sort of unzipping program to work with cmd then moving the files using cmd as well. if i use cygwin i would need to do manual work but with cmd i can write up a list of commands and let the computer do its thing.. Nov 2, 2011 at 15:19
  • 1
    Why do you think you need to do "manual work" if you use cygwin rather than cmd ? You can just run the above script "as is". Am I missing something ?
    – Paul R
    Nov 2, 2011 at 15:21
  • what i meant was i have to open cygwin and cmd.. i was gonna just write up a perl script since i can run it through cmd =/ Nov 2, 2011 at 15:23
  • 1
    But you can just do everything in a cygwin shell - you don't need a cmd window open too. All the usual DOS executables can be invoked directly from cygwin.
    – Paul R
    Nov 2, 2011 at 15:25

1 Answer 1

3

Take a look at the ss64 website bash section. Find your commands, and look up the equivalent windows command. Note that windows does not have tar and you will need to install it, or an alternative.

1
  • @JoeChen Not all of the commands are preinstalled by default on windows. check here for links to the resource kits that include the rest of the commands. Also note, some BASH commands do not have windows equivalents, such as ftp, sftp, and ssh. You will not to find 3rd party command line replacements, use cygwin, or build something in a programming language such as python or perl. Nov 2, 2011 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.