Cygwin File
-
So I need to check a iPhone backup to determine which files are the voicemails. Using cygwin I can do this, manually, item by item but that's a pain in the butt.
How do I run the "file" command against everything in this folder if there are no extensions for me to hit on. IE I can't use .
-
Is Cygwin a bash implementation on Windows? If that is the case:
FILES=/path/to/files/* For x in $FILES do file $x
Or something like that.
-
Nevermind, I think I've figured something out that will work.
But would be nice is to take a list from a CSV and rename every file with the .amr extension
-
@DustinB3403 said:
Nevermind, I think I've figured something out that will work.
But would be nice is to take a list from a CSV and rename every file with the .amr extension
I'm not a bash expert (or Cygwin) but try this:
cat files.csv | while read line do mv $file $file.amr done
I think. There are better ways to do this but that should get it done for the most part.
-
Doesn't seem to work
-
It is Windows so the UNIX mv command might be the issue. Do this with the straight text file you made, the CSV will not work without a lot of extra processing.
cat files.csv | while read line do echo $line done
-
@scottalanmiller Isn't Cygwin a bash emulation for Windows? Or am I thinking about something else?
-
@coliver you used line as your variable but then used $file, that won't work
-
@scottalanmiller said:
@coliver you used line as your variable but then used $file, that won't work
Doh, I knew something didn't look right.
-
cat file.txt | while read line; do mv $line $line.amr; done
Got it with the above.
Thanks guys
-
Time to build a how to