The for tag has no wiki summary.
1
vote
1answer
35 views
How can I iterate over directories in the Windows command prompt?
The Windows command prompt (cmd.exe) provides the FOR command. It can be used to do an operation for any file in a directory. Example:
\> dir
28.05.2012 18:25 69 buildall.bat
...
0
votes
0answers
29 views
Contacts not showing after imported int Outlook for Mac 2011
I've tried each of the suggested tricks suggested here to no avail. Even though Outlook acts as if I've successfully imported my contacts from a .csv file (in an excel document) into Outlook for Mac ...
0
votes
1answer
48 views
Output filenames with for loop in a batch file
I want to rename files with a batch command and capture the original and renamed files in a list in order to provide a cross reference (doing a DIR /OS >file both before and after the batch file is ...
0
votes
1answer
68 views
Is there a “FORCMD” variable (like “DIRCMD”, “COPYCMD”, etc.)?
The dir command checks for a dircmd environment variable for default arugments to use. Likewise, the copy and move commands check copycmd. Is there a corresponding variable (by any name) for the for ...
0
votes
1answer
64 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
111 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
290 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
1k 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
140 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
45 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
5k 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
209 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) ...