Sponsored Content
Full Discussion: Grades exercise
Homework and Emergencies Homework & Coursework Questions Grades exercise Post 303015880 by UniverseCloud on Sunday 15th of April 2018 09:48:44 PM
Old 04-15-2018
@jgt The grades are weird but thats how the exercise is given, haha.

Thank you guys!

P.S So after i added the spaces i am still getting this error "grades.sh: line 6: [: missing `]'"

Code:
if [ $grade > = 50 || $grade < 60 ]; then
echo "$name $grade F"
elif [ $grade > = 60 || $grade < 70 ]; then
echo "$name $grade C"
elif [ $grade > = 70 || $grade < 80 ]; then
echo "$name $grade B"
elif [ $grade > = 80 || $grade <= 100 ]; then
echo "$name $grade A"
else
echo "Wrong input"
fi


Last edited by Scrutinizer; 04-15-2018 at 11:17 PM.. Reason: Code tags
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[question] trouble with an 'exercise'

Hello guys.. well, im kinda newbie with unix because i started to learn it like 2 weeks ago. then i started to make some exercises, but i got stucked on this one : so, i need to know how many different 'names' has the 5th field and how many times each name appears. i was trying with a... (6 Replies)
Discussion started by: EnioMarques
6 Replies

2. UNIX for Dummies Questions & Answers

[question] hard exercise, help needed

Hello guys. Well, on this exercise i need the average "chargeAmount" per hour (for each hour). with this code : cat getusagesummarywrongmatch | grep -iv MOU2GRTObject | cut -d'|' -f4,14 | grep -i chargeamount | cut -d' ' -f2 http://img227.imageshack.us/img227/5889/65969235do0.jpg i got... (2 Replies)
Discussion started by: EnioMarques
2 Replies

3. Shell Programming and Scripting

Reading 5 Students names and grades using while loop????

How do I write a shell script file to read 5 student names (First and Last name) and their grades using a While Loop? Find the Average, Maximum, and Minimum of grades using the same While Loop. Prompt the user using tput to enter the information (first name, last name, grade). Save the data in a... (1 Reply)
Discussion started by: dlbomber1
1 Replies

4. Shell Programming and Scripting

Trouble with part of an exercise

Hi, 'm trying to do an exercicise, and one part is: ls -l $1 | awk ' BEGIN { max = $5; } { if ($5 > max){ max = $5; } } END { print "Tamanio mayor fichero = " max; }' # Imprimimos ahora el menor tamaņo de fichero ls -l $1 | awk '... (4 Replies)
Discussion started by: Phass
4 Replies

5. Homework & Coursework Questions

Help with this exercise

you are to write a program which will read in a tax rate (as a percentage) and the prices of 5 items. the program is to calculate the total price, before tax, of the items and then the tax payable on those items, and then the total amount due. the tax payable is computed by appliying the tax rate... (1 Reply)
Discussion started by: bunkercrazy
1 Replies

6. Shell Programming and Scripting

A very tough exercise

hello everyone!:) I have an exercise which I think is difficult for beginner like me. Here is the exercise Create a shell script, which takes a directory as command line argument. Script displays ten first lines from every text file in that directory. After displaying the lines from the... (1 Reply)
Discussion started by: googlevn
1 Replies

7. UNIX for Dummies Questions & Answers

UNIX Exercise

Hi, I am learning unix. I want to practice few small excercises. Please suggest me some goor URL to practice. Thanks in advance. (1 Reply)
Discussion started by: stew
1 Replies
MAC_LOMAC(4)						   BSD Kernel Interfaces Manual 					      MAC_LOMAC(4)

NAME
mac_lomac -- Low-watermark Mandatory Access Control data integrity policy SYNOPSIS
To compile LOMAC into your kernel, place the following lines in your kernel configuration file: options MAC options MAC_LOMAC Alternately, to load the LOMAC module at boot time, place the following line in your kernel configuration file: options MAC and in loader.conf(5): mac_lomac_load="YES" DESCRIPTION
The mac_lomac policy module implements the LOMAC integrity model, which protects the integrity of system objects and subjects by means of an information flow policy coupled with the subject demotion via floating labels. In LOMAC, all system subjects and objects are assigned integrity labels, made up of one or more hierarchal grades, depending on the their types. Together, these label elements permit all labels to be placed in a partial order, with information flow protections and demotion decisions based on a dominance operator describing the order. The hierarchal grade field or fields are expressed as a value between 0 and 65535, with higher values reflecting higher integrity. Three special label component values exist: Label Comparison low dominated by all other labels equal equal to all other labels high dominates all other labels The ``high'' label is assigned to system objects which affect the integrity of the system as a whole. The ``equal'' label may be used to indicate that a particular subject or object is exempt from the LOMAC protections. For example, a label of ``lomac/equal(equal-equal)'' might be used on a subject which is to be used to administratively relabel anything on the system. Almost all system objects are tagged with a single, active label element, reflecting the integrity of the object, or integrity of the data contained in the object. File system objects may contain an additional auxiliary label which determines the inherited integrity level for new files created in a directory or the alternate label assumed by the subject upon execution of an executable. In general, objects labels are represented in the following form: lomac/grade[auxgrade] For example: lomac/10[2] lomac/low Subject labels consist of three label elements: a single (active) label, as well as a range of available labels. This range is represented using two ordered LOMAC label elements, and when set on a process, permits the process to change its active label to any label of greater or equal integrity to the low end of the range, and lesser or equal integrity to the high end of the range. In general, subject labels are rep- resented in the following form: lomac/singlegrade(lograde-higrade) Modification of objects is restricted to access via the following comparison: subject::higrade >= target-object::grade Modification of subjects is the same, as the target subject's single grade is the only element taken into comparison. Demotion of a subject occurs when the following comparison is true: subject::singlegrade > object::grade When demotion occurs, the subject's singlegrade and higrade are reduced to the object's grade, as well as the lograde if necessary. When the demotion occurs, in addition to the permission of the subject being reduced, shared mmap(2) objects which it has opened in its memory space may be revoked according to the following sysctl(3) variables: o security.mac.lomac.revocation_enabled o security.mac.enforce_vm o security.mac.mmap_revocation o security.mac.mmap_revocation_via_cow Upon execution of a file, if the executable has an auxiliary label, and that label is within the current range of lograde-higrade, it will be assumed by the subject immediately. After this, demotion is performed just as with any other read operation, with the executable as the tar- get. Through the use of auxiliary labels, programs may be initially executed at a lower effective integrity level, while retaining the abil- ity to raise it again. These rules prevent subjects of lower integrity from influencing the behavior of higher integrity subjects by preventing the flow of informa- tion, and hence control, from allowing low integrity subjects to modify either a high integrity object or high integrity subjects acting on those objects. LOMAC integrity policies may be appropriate in a number of environments, both from the perspective of preventing corruption of the operating system, and corruption of user data if marked as higher integrity than the attacker. The LOMAC security model is quite similar to that of mac_biba(4) and mac_mls(4) in various ways. More background information on this can be found in their respective man pages. SEE ALSO
mmap(2), sysctl(3), mac(4), mac_biba(4), mac_bsdextended(4), mac_ifoff(4), mac_mls(4), mac_none(4), mac_partition(4), mac_portacl(4), mac_seeotheruids(4), mac_test(4), mac(9) HISTORY
The mac_lomac policy module first appeared in FreeBSD 5.0 and was developed by the TrustedBSD Project. AUTHORS
This software was contributed to the FreeBSD Project by Network Associates Labs, the Security Research Division of Network Associates Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (``CBOSS''), as part of the DARPA CHATS research program. BSD
December 11, 2002 BSD
All times are GMT -4. The time now is 12:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy