Find the answer to your Linux question:
Results 1 to 2 of 2
i have a couple of scripts i have to do for a class and i have absolutely no idea what to do . help will be greatly appreciated. i have ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    5

    [SOLVED] need help making scripts for solaris

    i have a couple of scripts i have to do for a class and i have absolutely no idea what to do . help will be greatly appreciated. i have to do the following:

    1. Write a script that will take its input and format it on the screen in three columns.

    2. Write a script that will reformat its input to convert all tabs to three spaces.

    3. Write a script that counts and lists both the ordinary files and the directories in the provided location. The output should be a user friendly message stating the number of ordinary files in the provided location, followed by a listing of the files (file names only). The script should then output a blank line. The next part of the output is another user friendly message stating the number of directories in the current location, followed by a listing of the directories (directory names only). Script should use variables.

    4. Write a script to display a user friendly message giving the number of hidden files in the current directory followed by a list of the hidden files.

    5. Write a script that will determine the largest file in the current directory. It should display a message such as “Your biggest file is insertFileNameHere and its size is insertSizeHere.” Script should use variables.

    6. Write a script that would run continually until it is interrupted. The script is to display the time once every 5 seconds. Hint: use the "sleep" command.

    7. Write a script that will take a person's name as a parameter to the program name. The script should greet that person, as
    Good Morning name_entered, How are you today?
    Or
    Good Afternoon name_entered, How are you today?
    Statement will depend on the actual time of the day.

    8. Write a script that will prompt the user for a name and display same message as above.

    9. Write a script that will determine the minimum and maximum values in a file. The format of the script must be minMax fileName where minMax is the name of the script and fileName is a parameter passed to minMax that is the name of the file that contains the data to be analyzed. The output of the script should have the format: In the file ___, the minimum value is ___ and the maximum value is ___. The blanks should include the filename, the minimum value and the maximum value.

    10. Write a script that will determine the minimum and maximum values that are input by the user. The format of the script must be extremes where extremes is the name of the script. The script should first display the following instructions: This script will display the minimum and maximum values that you input. After each number, press enter. When you are done entering numbers, press the 'q' key to quit. The script must calculate the minimum and maximum values that are entered by the user. The output of this script should have the format: The minimum value is ___ and the maximum value is ___.

    11. Write a script that first verifies that the file “myfile” exists. If it does not exist, display the message File does not exist. If it does exist, ask the user if they really want to delete the file. If they do, delete it.

    Please Help

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    It is not educational for you to ask people to do your homework for you. Some might consider it cheating. I would assume that the information you need to complete this assignment is to be found in your text books and/or class notes (you did take class notes, yes?).

    That said, solaris uses any number of shells. Assuming you are running the bash shell, then you should get a book on bash programming. Amazon.com carries the O'Reilly Nutshell series that includes a couple of decent bash programming volumes. Then there is the online bash documentation (Google for that), and your system man and info pages.

    If folks are smart, this is as much help as you will get - you need to do this work in order to learn it. My clients pay me $200 USD per hour for my system and programming knowledge and abilities, and I had to learn it all the hard way, by doing the work.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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