command-line

how to assign variable in shell script

狂风中的少年 提交于 2020-02-08 02:34:07
问题 I have below shell script code which is working fine. #!/bin/sh run() { cd /tmp/in/current java \ -Dlog4j.configurationFile=/tmp/in/logging/log4j2_Importer.xml \ -Djava.security.egd=file:///dev/urandom \ -classpath /tmp/in/runner/lib/*:/tmp/in/lib/* \ baag.runner.Application \ --config /tmp/in/config/import.dev.properties.TODO \ --workflow import \ --inputDir "$1" } dev_path="/data/etl-dev/in/eurex" simu_path="/data/etl-simu/in/eurex" mode=$1 case "$mode" in "$dev_path" | "$simu_path" ) run "

how to assign variable in shell script

走远了吗. 提交于 2020-02-08 02:33:13
问题 I have below shell script code which is working fine. #!/bin/sh run() { cd /tmp/in/current java \ -Dlog4j.configurationFile=/tmp/in/logging/log4j2_Importer.xml \ -Djava.security.egd=file:///dev/urandom \ -classpath /tmp/in/runner/lib/*:/tmp/in/lib/* \ baag.runner.Application \ --config /tmp/in/config/import.dev.properties.TODO \ --workflow import \ --inputDir "$1" } dev_path="/data/etl-dev/in/eurex" simu_path="/data/etl-simu/in/eurex" mode=$1 case "$mode" in "$dev_path" | "$simu_path" ) run "

Opening an eclipse project through command prompt or batch file

孤街醉人 提交于 2020-02-05 05:35:20
问题 I am building an application that is for testing using Selenium Java tool. Is there any way to open an existing eclipse project from the command line or through a batch file so that I can allow the users to select the testproject which is in Java with just a click of a button? I found that this command if for building a project eclipsec.exe -noSplash -data "D:\Source\MyProject\workspace" -application org.eclipse.jdt.apt.core.aptBuild But I couldn't find one for opening one. 回答1: If you omit

Is there a way to make a HTML link that would run a program from local computer?

删除回忆录丶 提交于 2020-02-05 05:30:26
问题 For debugging purposes it'd be nice if I could make my error page display clickable file names in exception stack traces that would open them up in my favorite editor. However this would require me to execute a full command line - a simple link to a file will not do. Can this be done? The solution can be IE-only and it can use techniques that require full trust (I don't expect it to be otherwise anyway). People are only going to use this on localhost, I will in fact disable this functionality

How to use pipenv in Python shell script?

笑着哭i 提交于 2020-02-05 04:34:09
问题 I needed a module for a shell script I've written in Python, so I used pipenv to install it. I can run the command fine using: ~$ pipenv run python3 foo Now, if I want to just run ~$ foo on the command line (fish shell on MacOS, homebrew installed), how do I invoke the pipenv environment in the shebang of my Python script? Or is there a better way? 回答1: With pipenv-shebang you can run your script with pipenv-shebang PATH/SCRIPT or you could insert the shebang #!/usr/bin/env pipenv-shebang to

Regular expression troubles, escaped quotes

☆樱花仙子☆ 提交于 2020-02-03 07:03:43
问题 Basically, I'm being passed a string and I need to tokenise it in much the same manner as command line options are tokenised by a *nix shell Say I have the following string "Hello\" World" "Hello Universe" Hi How could I turn it into a 3 element list Hello" World Hello Universe Hi The following is my first attempt, but it's got a number of problems It leaves the quote characters It doesn't catch the escaped quote Code: public void test() { String str = "\"Hello\\\" World\" \"Hello Universe\"

Downloading large files in Windows command prompt / PowerShell

守給你的承諾、 提交于 2020-02-02 02:41:27
问题 I'm kind of running out of options now... Attempt 1 Use iwr in Powershell. It works, shows progress but its 10X slower and doesn't flush until while file is in memory :(. powershell -command "& { iwr https://github.com/mitchellspryn/AirsimHighPolySuv/releases/download/V1.0.0/SUV.zip -OutFile SUV.zip }" Attempt 2 Use .Net webclient in Powershell. It works but shows no progress and you can't terminate by Ctrl+C :(. Last issue is a big setback. powershell -command "& { (New-Object System.Net

Batch file tokens ignore empty delimiters

早过忘川 提交于 2020-02-01 07:36:28
问题 I am trying to load a column from a CSV file into a variable. My CSV file contains empty columns so can have ,, which seems to be ignored by the following: FOR /F "tokens=3 delims=," %%a in (csvfile.csv) do ( set date=%%a echo %%a ) So if file csvfile.csv contains fred,wilma,tony, john, greg, wilber, blake chris,,steve,deon,bryan,mark,anthony I would like the result: tony steve But I get: tony deon If I put a white space in the empty column this does work as expected. How do I set delims so

Batch file tokens ignore empty delimiters

吃可爱长大的小学妹 提交于 2020-02-01 07:36:04
问题 I am trying to load a column from a CSV file into a variable. My CSV file contains empty columns so can have ,, which seems to be ignored by the following: FOR /F "tokens=3 delims=," %%a in (csvfile.csv) do ( set date=%%a echo %%a ) So if file csvfile.csv contains fred,wilma,tony, john, greg, wilber, blake chris,,steve,deon,bryan,mark,anthony I would like the result: tony steve But I get: tony deon If I put a white space in the empty column this does work as expected. How do I set delims so

Gradle test Unit tests - Run all except one or few - Command line

跟風遠走 提交于 2020-01-31 12:09:53
问题 I have bunch of JUnit unit tests in my projects. Build system is Gradle. OS: Windows/Linux. Test (Unit tests) come free in Gradle i.e. if you run " gradle clean build " Gradle will also run "test" task (to run your Unit tests). I know how can I run all tests in a test folder, of a specific test at command line. Ex: See 23.13.3 and 23.13.4 sections in Gradle user guide: http://www.gradle.org/docs/current/userguide/java_plugin.html#sec:java_test My question: I want to run all tests except one