Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Can someone convert a short DOS script to shell script?

Here's the script. I'd like it to be Linux compatible as it is currently made for a Windows computer. Java is installed on the Linux machine.

http://tinypaste.com/3e957

1 Answer

Relevance
  • Fred
    Lv 6
    1 decade ago
    Favorite Answer

    I am not familiar with the CD command you've used, but with a little tinkering, this might do:

    #!/bin/bash

    # Use cd to switch to the desired directory

    # Set variables

    JAVAPATH='/path/to/your/java/executable'

    cd <your directory here>

    rm -rf compressed/*

    rm -rf mini/*

    for f in *

    do

    $JAVAPATH -jar html.jar $f -o resources/mini/$f && gzip -c -9 resources/mini/$f >> resources/compressed/$f.jgz

Still have questions? Get your answers by asking now.