Find the answer to your Linux question:
Results 1 to 3 of 3
Okay, I'm a college student and I'm having a really hard time with our scripting lab. I was wondering if anyone had any sites to suggest me visiting that might ...
  1. #1
    Just Joined! ~Lexy~'s Avatar
    Join Date
    Nov 2007
    Location
    Rocky Mountains
    Posts
    2

    Unhappy Assistance and Suggestions needed please...

    Okay, I'm a college student and I'm having a really hard time with our scripting lab. I was wondering if anyone had any sites to suggest me visiting that might help me with the following question:

    "Create a script that will produce a text file that has a list of the files in the present working directory. Ensure you use the proper syntax to allow auto-execution from the command prompt. Use internal documentation (comments) to place your name and the course name in the script."

    I've gotten the script to create the text file listing the files of the current directory, ls -a |tee AllFiles.txt, but getting it to include my name and course name in the script is where I get lost.

    Any suggested sites would be greatly appreciated... Thanks.

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Just a couple of hints.

    Code:
    echo "some text" > a.txt
    Will create or overwrite the file a.txt, the file will only contain "some text"

    Code:
    echo "Some more text" >> a.txt
    Will create or append the file a.txt, if you run both of those commands a.txt will contain

    some text
    Some more text

    This is called redirection

    Have a play, and you don't need anything more than to add some > and >>
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  3. #3
    Just Joined! ~Lexy~'s Avatar
    Join Date
    Nov 2007
    Location
    Rocky Mountains
    Posts
    2
    Thanks, the help is very much appreciated.




    Well, I think I got that first part figured out. Now I'm off to work on the next part.
    Last edited by ~Lexy~; 11-29-2007 at 04:26 PM. Reason: Working on the next part of the Lab...

Posting Permissions

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