How do you execute a shell script file??

This is a discussion on How do you execute a shell script file?? within the Tech Board forums, part of the Community Boards category; I know this may not be a very intelligent question, but, how do you execute a shell script file in ...

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,597

    How do you execute a shell script file??

    I know this may not be a very intelligent question, but, how do you execute a shell script file in windows? I tried changing it's extention from .sh to .bat, but it seems that the scripts aren't the same. I'm somewhat confused about this, as I have read it has somthing to do with unix??
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Yes, shell script is "batch files in Unix". Both formats support executing applications, doing simple flow-control and variable stuff, such as for-loops, gotos, if statements, and such like.

    To run a shell-script in Windows, you need to have a shell implemented in Windows. There are some of those available. You will also need to have all applications that the script makes use of [naturally].

    Here's a link that google put as "best match" when I searched for "csh for windows".
    http://www.shelldorado.com/links/

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,236
    Quote Originally Posted by Yarin View Post
    I know this may not be a very intelligent question, but, how do you execute a shell script file in windows? I tried changing it's extention from .sh to .bat, but it seems that the scripts aren't the same. I'm somewhat confused about this, as I have read it has somthing to do with unix??
    A shell script is interpreted by a shell. You don't have a shell, so you can't run a shell script.

    Shell scripts often rely on UNIX commands that don't exist on Windows, too.

    If you download and install Cygwin, you might be able to make it work.

  4. #4
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,236
    Quote Originally Posted by matsp View Post
    Yes, shell script is "batch files in Unix". Both formats support executing applications, doing simple flow-control and variable stuff, such as for-loops, gotos, if statements, and such like.
    Must disagree on the "simple" part. You can write very complex functionality in shell script. For an undergraduate class, I wrote a cross-platform virus in pure sh script.

  5. #5
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,597
    Okay, thanks. I downloaded Cygwin, but I'm on a library computer right now;
    I just finished downloading Fedora 8 (Gmone & KDE). Yay!
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  2. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM
  5. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21