ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Cygwin File

    IT Discussion
    cygwin files extension apple
    3
    11
    2.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403
      last edited by

      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 .

      1 Reply Last reply Reply Quote 1
      • coliverC
        coliver
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • DustinB3403D
          DustinB3403
          last edited by

          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

          coliverC 1 Reply Last reply Reply Quote 0
          • coliverC
            coliver @DustinB3403
            last edited by

            @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.

            scottalanmillerS 1 Reply Last reply Reply Quote 2
            • DustinB3403D
              DustinB3403
              last edited by

              Doesn't seem to work

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller
                last edited by

                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
                
                coliverC 1 Reply Last reply Reply Quote 1
                • coliverC
                  coliver @scottalanmiller
                  last edited by

                  @scottalanmiller Isn't Cygwin a bash emulation for Windows? Or am I thinking about something else?

                  1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @coliver
                    last edited by

                    @coliver you used line as your variable but then used $file, that won't work 🙂

                    coliverC 1 Reply Last reply Reply Quote 0
                    • coliverC
                      coliver @scottalanmiller
                      last edited by

                      @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.

                      1 Reply Last reply Reply Quote 1
                      • DustinB3403D
                        DustinB3403
                        last edited by

                         cat file.txt | while read line; do mv $line $line.amr; done
                        

                        Got it with the above.

                        Thanks guys 🙂

                        1 Reply Last reply Reply Quote 2
                        • DustinB3403D
                          DustinB3403
                          last edited by DustinB3403

                          Time to build a how to 😛

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post