SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: shell scripting

  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    shell scripting

    Hi guys,
    I need to make a shell script named test X Y (X is a string and Y is a valid positive integer) which traverses the $ PATH variable and writes all the executables in the $PATH directories that contain the given string parameter X, which were accessed in Y last minutes, giving the desired subtrees. I must use the find command for this script.

    anybody can help?

    thanks

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sounds like a homework assignment, in which case your resources for help are reference materials from the class and your TA.

  3. #3
    SitePοint Troll disgracian's Avatar
    Join Date
    Aug 2006
    Location
    Samsara
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Show us what you have come up with so far.

    Cheers,
    D.

  4. #4
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's what i've got so far...
    what do you think?

    #!/bin/bash
    IFS=:

    for i in $PATH
    do
    find . -maxdepth 1 -amin -$1 -name $2
    done


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •