command-line-interface

Pass parameter to Azure CLI Task in DevOps

て烟熏妆下的殇ゞ 提交于 2021-02-20 13:26:49
问题 How do you pass a parameter to an Azure CLI Task in Azure DevOps? Take the very basic example of showing basic info about a VM. A basic CLI command would be: az vm show --name myVM --resource-group dev -o table Now if I wanted to parameterize that command, so that I could pass in the VM Name, who would i do it? I've tried creating a CLI Task as both an in-line script and a file, passing parameters using the Azure DevOps Argument builder, but nothing seems to work. The parameter looks like

How to grep a term from S3 and output object name

谁说我不能喝 提交于 2021-02-20 04:49:07
问题 I need to grep a term over thousands of files in S3, and list those file names in some output file. I'm quite new using cli, so I've been testing both on my local, and in a small subset in s3. So far I've got this: aws s3 cp s3://mybucket/path/to/file.csv - | grep -iln searchterm > output.txt The problem with this is with the hyphen. Since I'm copying over to standard output, the -l switch in grep returns (standard input) instead of file.csv My desired output is file.csv Eventually, I'll need

JQ, Hadoop: taking command from a file

房东的猫 提交于 2021-02-19 08:33:00
问题 I have been enjoying the powerful filters provided by JQ (Doc). Twitter's public API gives nicely formatted json files. I have access to a large amount of it, and I have access to a Hadoop cluster. There I decided to, instead of loading them in Pig using Elephantbird , try out JQ in mapper streaming to see if it is any faster. Here is my final query: nohup hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-2.5.1.jar\ -files $HOME/bin/jq \ -D mapreduce.map.memory.mb=2048\ -D

JQ, Hadoop: taking command from a file

Deadly 提交于 2021-02-19 08:32:21
问题 I have been enjoying the powerful filters provided by JQ (Doc). Twitter's public API gives nicely formatted json files. I have access to a large amount of it, and I have access to a Hadoop cluster. There I decided to, instead of loading them in Pig using Elephantbird , try out JQ in mapper streaming to see if it is any faster. Here is my final query: nohup hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-2.5.1.jar\ -files $HOME/bin/jq \ -D mapreduce.map.memory.mb=2048\ -D

In ClearCase, need CLI invocation to list all revisions

纵然是瞬间 提交于 2021-02-19 08:19:26
问题 I'm attempting to add support for reading ClearCase repositories to reposurgeon. I've been able to puzzle out most of what I think I need, but the documentation is a massive pile of confusing details that leaves one basic question obscure. How do I list all revisions in a CC repository? The minimum thing I need would be a time-ordered sequence of lines each containing a revision ID (path, branch, revision level) and its parent revision ID. Revisions for directories should be included because

Start-Process with PowerShell.exe exhibits different behavior with embedded single quotes and double quotes

喜你入骨 提交于 2021-02-18 19:00:44
问题 First, in case anyone wonders why we're invoking PowerShell in this way, I ran into this behavior with a more complex command we were building, but the behavior can be exhibited using a more simple example as shown below. In practice, we are running a command under 32-bit PowerShell as admin with additional variables rendered in the string (hence why I don't simply use single-quotes for the outer portion), but that doesn't seem to factor into the behavior below. When I invoke PowerShell

Start-Process with PowerShell.exe exhibits different behavior with embedded single quotes and double quotes

耗尽温柔 提交于 2021-02-18 18:59:38
问题 First, in case anyone wonders why we're invoking PowerShell in this way, I ran into this behavior with a more complex command we were building, but the behavior can be exhibited using a more simple example as shown below. In practice, we are running a command under 32-bit PowerShell as admin with additional variables rendered in the string (hence why I don't simply use single-quotes for the outer portion), but that doesn't seem to factor into the behavior below. When I invoke PowerShell

How to create a CLI in Python that can be installed with PIP?

£可爱£侵袭症+ 提交于 2021-02-18 12:52:31
问题 As the title suggests, I'm trying to make a python script accessible from the command line. I've found libraries like click and argv that make it easy to access arguments passed from the command line, but the user still has to run the script through Python. Instead of python /location/to/myscript.py I want to be able to just do myscript from any directory From what I understand, I can achieve this on my computer by editing my PATH variables. However, I would like to be able to simply do: pip

npm install is building .cmd files in my angular project root directory

拈花ヽ惹草 提交于 2021-02-18 12:42:15
问题 I have a project that I've been working with for quite some time and it has built and compiled (and still does on a different machine) for months. Now, when I run the command npm install it runs as normal, but at the end of the process, it builds out tons of .cmd files (and another accompanying file) in the root folder of my project. when I run ng serve i get the error: Unknown browser query basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") I'm completely stumped as to how to get my

Parsing HTML on the command line; How to capture text in <strong></strong>?

假如想象 提交于 2021-02-18 06:47:06
问题 I'm trying to grab data from HTML output that looks like this: <strong>Target1NoSpaces</strong><span class="creator"> .... <strong>Target2 With Spaces</strong><span class="creator"> .... I'm using a pipe train to whittle down the data to the targets I'm trying to hit. Here's my approach so far: grep "/strong" output.html | awk '{print $1}' Grep on "/strong" to get the lines with the targets; that works fine. Pipe to 'awk '{print $1}'. That works in case #1 when the target has no spaces, but