We aren't endorsed by this school

Parkland - CSC 128
  • 1 Page function_small.sh
    Function_small.sh

    School: Parkland

    #!/bin/bash easy_fn() { echo $1 echo $2 } echo $1 echo $2 easy_fn "Function argument one" "function arg 2"

  • 1 Page file_testing.sh
    File_testing.sh

    School: Parkland

    #!/bin/bash #here is an example of testing to see if a file exists echo please enter a file name read filename if test -e $filename then echo yes it is there else echo sorry not found fi

  • 1 Page echo.sh
    Echo.sh

    School: Parkland

    #!/bin/bash echo press q to quit read answer if test $answer = q then exit 1 else echo you didnt press q fi

  • 1 Page negation.sh
    Negation.sh

    School: Parkland

    #!/bin/bash if test string1 != string1 then echo "string1 != string1" else echo "string1 is= string1" fi

  • 1 Page stderr.sh
    Stderr.sh

    School: Parkland

    #!/bin/bash #rediredct stdout and err like this: # >file 2>&1 ecyoh adgfadfhgdf echo above is a mistake

  • 1 Page for.sh
    For.sh

    School: Parkland

    #!/bin/sh #see documentation on page 379 #run this from the scriptsource directory and it will work #general usage: #for <arg> in [ list ] #do # commands #done for i in mary had a little lamb do echo the next word in the list is: $i sleep .5 d

  • 1 Page test.sh
    Test.sh

    School: Parkland

    #!/bin/bash echo here we go on testing for a command line parameter #this tests for an integer #if test $1 -eq 7 #this tests for a string if test $1 = 7 then echo It\'s here and it\'s a $1 else echo It\'s not here but it\'s a $1 fi

  • 1 Page function_demo_1.sh
    Function_demo_1.sh

    School: Parkland

    #!/bin/bash err_fn() { echo '$1' passed to the function is $1 echo '$2' passed to the function is $2 exit 1 } echo '$1' from the command line is $1 echo '$2' from the command line is $2 read stop if [ $# -ne 2 ] then err_fn " you are wron

  • 1 Page number_of_args.sh
    Number_of_args.sh

    School: Parkland

    #!/bin/bash #This shows the number of command line args echo The VALUE of '$1' is now $1 echo You entered $# command line args. shift #the shift threw out the first command line arg echo You now have $# command line args left. echo The VALUE of '$

  • 1 Page lab_redirection_class
    Lab_redirection_class

    School: Parkland

    Run at least 25 different redirections. Grep them out of your history and put them in a file in your website (in your public_html directory) called redirection.txt I will show you how to do this in class. I will grade this on Wednesday during the

  • 1 Page awk_lab
    Awk_lab

    School: Parkland

    awk Lab. 15 points for the online section Look at the web page about awk and study up on it. Then in your bin you will place 3 files. README_awk.txt mydata.txt awkscript.awk Be sure that you chmod them 644 so that I can see them. In README_awk.tx

  • 1 Page lab_vi
    Lab_vi

    School: Parkland

    CSC128 Lab - vi practice 15 points Name _ Copy ~smauney/public/poem to your home directory, leave the name as poem. chmod the poem so that you can make changes to it. 1. Remove all of the windows line feeds. __ 2. Delete Line 4 3. Rep

  • 2 Pages find_commands
    Find_commands

    School: Parkland

    Below are some examples of some find commands that were grepped out of my .bash_history. Try to see if you can do some of them, and figure out what they do. find . -mtime 24 find . -mtime -1 find . -name *.html find . -name public_html/*.html find

  • 2 Pages x
    X

    School: Parkland

    +0+0 -0+0 Lab X intro This lab will have you trying out the following xapplications. Go through all of these and write by them what happened or what you found. Turn this in at the end of class today. You need to get a partner and practice

  • 1 Page lab_operators
    Lab_operators

    School: Parkland

    Logical Operators Lab 15 points. You will write a shell script named operators.sh and place it in your bin. Be sure that it is executable by me. This shell script will ask the user to enter a number between 1 and 100, the script then tells the user

  • 1 Page lab_groups
    Lab_groups

    School: Parkland

    Groups Lab 15 points. Read the web page that I have linked to in Week14. Also read and look at the man pages for the utilities and practice the utilities that are on the web page. Then make a directory in your bin called groups In that directory

  • 2 Pages redirection2
    Redirection2

    School: Parkland

    194 history |grep '>' | wc | > redirection.txt 197 history |grep > 198 history |grep '>' 199 history |grep '>' >redirection.txt 201 history |grep '|' >redirection.txt 269 head sgriffiths2 >head_steve 270 head poem >head_sean 51

  • 2 Pages commands
    Commands

    School: Parkland

    LINUX FIRST COUPLE OF WEEKS PRACTICE THESE IN THE SHELL Command Example Definition ctrl-c = Stop the execution of a program q = Quit a man page or

  • 1 Page find_example
    Find_example

    School: Parkland

    find -mtime -1 -name '*' -exec grep "Subnet" '{}' \; -print See pages 730-735 on the find utility This find does the following: finds files in the current directory (in some environments it will look into subdirectories also) to be sure that yo

Back to course listings