How to execute 7zip commands from nant script? - zip

I need to execute 7zip commands from nant script. How can I do that?
I have tried it like this, but it is not working
&ltexec program="7z.exe" basedir="${sevenzipinstalldir}" commandline="7z a D:\NantTest\Experiment\NewLab\7ziptest.zip -pmypassword D:\NantTest\Experiment\NewLab\"

<exec program="7z.exe" basedir="${sevenzipinstalldir}" commandline="a D:\NantTest\Experiment\NewLab\7ziptest.zip -pmypassword D:\NantTest\Experiment\NewLab\" />
(Don't repeat the executable name in commandline.)

Related

makeself running startup script as sourced script

I was making a self extractable archives using makeself and able to generate and run it.But i have to run the install script as sourced script.
I am seeing an option to pass script argument in makeself command
makeself.sh [args] archive_dir file_name label startup_script [script_args]
But none of my arguments are picking up. I have generated the archives using the following command
makeself.sh ./test ./test.run "sample installer" ./install.sh
but how can I tell makeself to run install.sh file as sourced script
i Have found out a alternate solution for the issue. Not the actual fix anyway it is working.Instead of calling install.sh as starter script i have added another script which will call the install.sh as sourced script.
makeself.sh ./test ./test.run "sample installer" ./launcher.sh and launcher.sh wil contain the following content
Launcher.sh file
source ./install.sh

Calling upon shell scripts / . jar files from within a bash script

So I have a bash script which has some .sh files within it, the .sh files contain instructions to copy from and execute a .jar file which is also called upon at the beginning of the script. I can't seem to successfully execute the .sh files but the .jar file at the beginning executes without any issues. Here is what I mean: java -jar energyapp-SNAPSHOT-jar-with-dependencies.jar &This is at the beginning, and has no problem executing. Then later in the script I have this: ./mAhSim.sh & sh ./solarsim.sh & sh ./batterysim.sh &. These have instructions as follows:
java -cp energyapp-simulators-0.0.5-SNAPSHOT-jar-with-dependencies.jar com..xml.SolarSimulator'
but when I execute it, it fires up the browser as expected, but I get an error reading "Error retrieving events & data"
Any help is greatly appreciated, thanks folks
You can use source command to execute another shell script within the same folder.
Use this:
source filename.sh
Or you can use the alias:
. filename.sh
Also make sure all your files are executable.
So you can do:
source mAhSim.sh && source solarsim.sh && source batterysim.sh

Shell script file with multiple commands

I want to make shell script file in windows and linux with multiple commands inside it.
E.g run.sh and run.bat with the below commands
run.bat or run.sh
mvn clean
mvn install
mvn exec:java
When I run my run.bat file it only executes first command mvn clean but it do not execute other commands.
How to make shell-script file with multiple commands so that when I execute it, It executes all commands inside it.
Thanks.
mvn is bat file but not binary.
Try with
call mvn clean
call mvn install
call mvn exec:java

Do we need to modify .sh file while executing in Windows?

I have one .sh file which runs well on MAC system. I want to run the same .sh file on windows using CYGWIN. My question is, Do I need to make any modification in the commands while using it in Windows system with CYGWIN? Please help.
e.g. I have the following commands in .sh file-
export ML_SERIALIZE_DIR=/Users/Mxyz/ML
export ML_SERIALIZE_GRAPH=true
echo ML_SERIALIZE_DIR = $ML_SERIALIZE_DIR
echo ML_SERIALIZE_GRAPH = $ML_SERIALIZE_GRAPH
java -DCL_LOG_DIR="/Users/Mxyz/ML" -classpath .:lib/:Ml-mobxyz-import.jar org.xy.mobxyz.mobxyz.ML
echo "Batch program is complete"
No need to change anything but make sure that all required binaries by your .sh must be there in CYGWIN

Linux version of a .cmd file

I am creating a terminal program and cannot find out what the ending is for Linux. I know in windows it is .cmd. Any help would be great.
Thank you.
Yes, you can remove the .sh at the end and it should work, generally using ./cmd will get it to run. this goes for C programs as well. You do not need to give an extension for the object file, You could then add a path to your bash file and then you can execute it as a normal command.
Look here.
https://stackoverflow.com/a/8779980/2720497
You don't need a file extension on Linux, though typically, people use .sh (sh being short for 'shell').
You can run it one of two ways:
bash myscript.sh
or you can make the script itself executable and run it directly:
chmod a+x myscript.sh # make it executable
./myscript.sh # run it
Linux scripts' first line is typically #!/bin/bash which is the path to the specific shell used to run the script with the second method.

Resources