Scala Execute Shell file [duplicate] - scala

This question already has answers here:
Execute shell script from scala application
(2 answers)
Closed 5 years ago.
I have a .sh file in which I want to run in Scala once a Gatling scenario has finished.
Does anyone have any code that would execute my sh script.

You should use the after block provided by Gattling :-
Refer this : https://gatling.io/docs/current/general/simulation_structure/#hooks
Here you can use after block :-
after { println("Simulation is finished!")}
Rest all is pure scala so use #Andrey answer above

Related

prompt not appearing after running `perl` [duplicate]

This question already has answers here:
How can I start an interactive console for Perl?
(24 answers)
Closed 1 year ago.
I have asked a similar question elsewhere but it eventually evolved into a series of comments. So once again, what package should I install to see the following prompt > after running perl but now not raku (all under Cygwin)?
EDIT
-l doesn't work either.
EDIT 2
Perl -d -e1 doesn't work for me either (Answer in comments as this question is closed):
You didn't provide the name of a program, and you didn't provide a program via the -e or -E command line options, so it's reading the program from STDIN.
perl does have a builtin debugger that you access by passing -d, but you still need to provide a program. (You can provide a trivial one using -e1.)
See How can I start an interactive console for Perl? for alternatives.

What's the equivalent of 'set -e' (exit on any errors) in Powershell? [duplicate]

This question already has answers here:
How to stop a PowerShell script on the first error?
(11 answers)
Closed 3 years ago.
I've been using Unix for about 20 years, but only started using Powershell recently. I have a ps1 script that does a number of tasks.
I know I could check each of them, and throw if they error, but it would be good for the entire script just to exit on any errors - like set -e does in bash.
How can I make a Powershell script exit immediately upon any error?
Using pwsh 6.2.1.
Having just found the answer to my own question:
ErrorActionPreference does this.
$ErrorActionPreference='Stop'
at the top of the ps1 file.

How to run a script from another script in another thread of execution [duplicate]

This question already has answers here:
How do I run a Perl script from within a Perl script?
(9 answers)
fork + exec + caller should not wait for child
(2 answers)
perl fork() exec() , child process gone wild
(2 answers)
Perl - Communicating with a fork/exec'ed process
(2 answers)
What's the difference between Perl's backticks, system, and exec?
(5 answers)
Closed 5 years ago.
How can I start a perl script from within a perl script but without being part of the same thread of execution. Like forking and letting the original script continue execution?
I think system does not do that as I see in the same console the output of the other script

Startup Parameters within the Script? [duplicate]

This question already has answers here:
Is there a way to programmatically set the ApartmentState to STA?
(2 answers)
Closed 7 years ago.
I have a script that needs to run in single-threaded mode, and I currently start it up with the -sta parameter with a batch. Is it possible to run the script in -sta mode only executing the Script? I thought about moving the whole script into one function and execute this function in single-threaded mode.
Is that possible? I don't want to give out a batch file and my ps1.
I think if you were to get PowerGUI and put the script into this, you would be able to package the PS1 file into an exe file which can just be executed like a normal program.
Once PowerGUI is installed you can do this from Tools, Complile Script.

how to set environment variable in linux using perl script [duplicate]

This question already has answers here:
Can we set a variable used in a Perl script as environment variable?
(2 answers)
Closed 7 years ago.
how do you set environment variable in linux using perl script.
Code:
#!/usr/bin/perl
system ('export TEST_ENV=TEST123');
not working. Please help
use %ENV for that:
#!/usr/bin/perl
$ENV{'TEST_ENV'} = 'TEST123';