How can we write a C shell script to make Dirs

This is a discussion on How can we write a C shell script to make Dirs within the Linux Programming forums, part of the Platform Specific Boards category; How can we write a C shell script to make Dirs, and subdirs, and help file in each subdirs? someone ...

  1. #1
    Unregistered
    Guest

    How can we write a C shell script to make Dirs

    How can we write a C shell script to make Dirs, and subdirs, and help file in each subdirs?

    someone said have to use FOREACH loop, but I don't really understand the function and instruction of Foreach.

    any example will be helpful.

  2. #2
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    this was one of the oldest DOS Attack

    for ever
    mkdir something
    cd something


    actually a directory takes some place 512 bytes i think so after few hrs u r screwed

  3. #3
    B26354 Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    Code:
    foreach var (wordlist)
       # Commands
    end
    The variable var is successively set to each member of wordlist. Members of the wordlist are space seperated.

    Example:
    Code:
    #!/bin/csh
    
    foreach color (red orange yellow green blue)
      echo $color
    end
    The wordlist may also include wildcards:
    Code:
    #!/bin/csh
    
    foreach file (*)
      cat file
    end
    HTH,
    Jason Deckard

  4. #4
    Unregistered
    Guest
    thank you

    that's some help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 02:47 PM
  2. Arguements with a shell script
    By Doh in forum Linux Programming
    Replies: 1
    Last Post: 11-28-2002, 02:20 PM
  3. How to make a simple shell?
    By ranger in forum Linux Programming
    Replies: 0
    Last Post: 03-31-2002, 03:09 AM
  4. write then make R-O
    By confusedcoder in forum C++ Programming
    Replies: 1
    Last Post: 01-25-2002, 07:53 AM

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