#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2009
    Posts
    7
    Rep Power
    0

    Other shell commands


    How do I remove from the current directory all ordinary files that are
    (i) hidden: rm .*
    (ii) begin and end with #: rm #*#
    (iii) have all numerals as the first three characters: rm [0-9][0-9][0-9]*
    (iv) have single-character extensions?

    I want to do above all things in: bourne shell, c shell and Korne shell
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2006
    Posts
    2,632
    Rep Power
    1811
    I smell homework!
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2007
    Posts
    44
    Rep Power
    14
    Originally Posted by SimonJM
    I smell homework!
    I do too - the sad thing is, who teaches C Shell anymore?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jul 2004
    Location
    Middle Europa
    Posts
    1,198
    Rep Power
    17
    Originally Posted by Bardon
    I do too - the sad thing is, who teaches C Shell anymore?
    csh ON CMD LINE is the ROLLS-ROYCE, in europe we prefer MAYBACH,
    a TRABANT in scripts

    to save remove that files:
    make a list
    edit this list
    remove the filenames you will keep
    set the path, masking and/or using doublequotes
    create the rm cmd, prepending 'rm ./ '
    run the script with the '-x' opt, to look what happens
    make changes if needed
    re-run, and so on....
    if ok, comment the '-x' opt and run
    working on Solaris[5-9], preferred languages french and C.

IMN logo majestic logo threadwatch logo seochat tools logo