The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
5 views

batch: wmic difficulty in FOR loop

I'm trying to learn to write batch files so I can be more useful at work, but I'm having some difficulty with wmic inside a for loop. (even if there is a better way to do this with PowerShell or ...
0
votes
1answer
19 views

Copy from sheet2 to sheet1 based on if values match

The goal of this code is to iterate through a column in sheet1 and check to see if each value matches that of values in a row in sheet2. If the value matches, copy 5 rows of information from sheet2 ...
3
votes
2answers
25 views

How to work around Bash for loop not exiting when a subcommand errors?

I have a for-loop in a shell script a la: #!/bin/bash set -u set -e for l in sh rb py php java cs; do (cd $l; ./run-tests.sh) done The intent is to have the for-loop die in a fire when any one of ...
0
votes
1answer
50 views

Need help creating a .bat file to execute SAS jobs

Using Windows 7, I need a .bat file that will execute files in a folder whenever I put them in there. for example I want it to execute files with a .sas suffix and then rename them once executed. I ...
0
votes
1answer
56 views

Append an index number to a variable name in bash?

I am trying to loop through numbered variables but am having a hard time appending the loop index number to the base variable name. Code follows, using a 2-iteration example: #ENTER TOTAL NUMBER OF ...
1
vote
1answer
70 views

Problems using a batch file For loop to feed .tifs into a GIS process (gdal_polygonize)

Thanks in advance for your help with this. I've been reading, experimenting, and banging my head against the wall for a couple days on this, and could really use some assistance. This is my first ...
-1
votes
1answer
36 views

Pass a variable in skip of for loop [closed]

Can we pass a variable in for loop as in below example: @ECHO off SETLOCAL ENABLEDELAYEDEXPANSION set /A counter=6 echo !counter! for /f "skip=!counter! tokens=1-18 delims=]" %%A in ...
2
votes
1answer
44 views

For command not processing lines from a file

I dumped all the physical network GUIDs to a file via: wmic nic where "PhysicalAdapter = 'TRUE'" get GUID > networkAdapterGUIDs.txt When I try to read the file and echo out its contents nothing ...
1
vote
2answers
55 views

why does this work in a shell for loop but not by itself

why does this work for X in A* ; do cp $X/output.txt output/$X.txt ; done but not this cp A*/output.txt output/A*.txt For copying the output.txt file from multiple folders called A1, A2, A3, ...