Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
48 views

How to make for /f deal with space in the file path?

The command for /f %%f in (c:\path\list.txt) do echo %%f gets confused if path contains spaces. Typically, I'd just put quotes around the path (in ("c:\path with spaces\list.txt") do), but in this ...
6
votes
1answer
94 views

Why you don't read lines with “for” in bash?

I've read that using "for" is not a good way to read lines in bash. Many people says this is clumsy and inefficient at best, and fails in many cases. I'd like to know what is the best way to read ...
1
vote
2answers
193 views

How to iterate over all pair combinations in a list in bash?

I define a list in bash like this: list="element1 element_2 my_element_3 element04" and I want to do a loop where I iterate through all possible pair combinations. In Perl, I would use a ...
5
votes
5answers
654 views

In Windows, a batch file with a recursive for loop and a file name including blanks

I have a folder tree, like this (it's only an example, it will be deeper in my real case): C:\test | +---folder1 | foo bar.txt | foobar.txt | +---folder2 | foo bar.txt | ...
0
votes
4answers
122 views

Unix script: use of date and use of for

MinuteNow=date +%M; for ((i=2;i<=57;i+=5)) do if [ "$MinuteNow" == "$i" ]; then ************* fi done The problem is for 2 and 7, the date commande output is 02 ...
0
votes
1answer
43 views

Can MS Services for Unix be deployed and accessed from a shared drive?

I'm interested in experimenting with replacing our dependency on MKS with MS' Sevices for Unix toolset. I was wondering if anyone has any experience with deploying SFU on a shared drive? We like to, ...
6
votes
7answers
3k views

Making BASH script `for` handle filenames with spaces (or workaround)

Whilst I have been using BASH for several years, my experience with BASH scripting is relatively limited. My code is as below. It should grab the entire directory structure from within the current ...
0
votes
2answers
174 views

Windows command FOR /F isn't working?

I'm trying to use the FOR command in Windows XP's command line. I have a file temp.txt with 3 lines: temp1 temp2 temp3 And I'm typing the following command at the prompt: for /F %p in (temp.txt) ...