Shell script to find all programs and scripts with setgid bit set on

in Categories Monitoring last updated April 10, 2008

setuid and setgid (short for set user ID upon execution and set group ID upon execution, respectively) are Unix access rights flags that allow users to run an executable with the permissions of the executable’s owner or group. They are often used to allow users on a computer system to run programs with temporarily elevated privileges in order to perform a specific task. While the assumed user id or group id privileges provided are not always elevated, at a minimum they are specific.

setuid and setgid are needed for tasks that require higher privileges than those which a common user has, such as changing his or her login password. Some of the tasks that require elevated privileges may not immediately be obvious, though — such as the ping command, which must send and listen for control packets on a network interface.

Sample Shell Script

Bash shell script to reverse text file contain using Shell array

in Categories File-management last updated July 24, 2008

This script also demonstrate how to use arrays under bash shell script.

Shell script to find whether an input number is palindrome or not

in Categories Academic, Shell Math last updated April 12, 2008

A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction (the adjustment of punctuation and spaces between words is generally permitted). Composing literature in palindromes is an example of constrained writing. The word “palindrome” was coined from Greek roots palin (“back”) and dromos (“way, direction”) by English writer Ben Jonson in the 1600s.

A palindromic number is a number where the digits, with decimal representation usually assumed, are the same read backwards, for example, 58285. They are studied in recreational mathematics where palindromic numbers with special properties are sought. A palindromic prime is a palindromic number that is a prime number.

Shell Script to read any year and find whether it is a leap year or not

in Categories Time and Date last updated April 5, 2008

A leap year comes once every four years. It is the year when an extra day is added to the Gregorian calendar used by most of the world.

An ordinary year has 365 days. A leap year has 366 days. The extra day is added to the month of February. In an ordinary year, February has 28 days. In a leap year, it has 29 days. This extra day is called a leap day.

How do I find out leap year?

A year is a leap year if it can be evenly divided by four. For example, 1996 was a leap year. But a year is not a leap year if can be evenly divided by 100 and not by 400. This is why 1700, 1800, 1900 were not leap years, but 2000 was.

Shell script to determine if entered year is leap or not…

Shell script to read a number and find whether the number is odd or even

in Categories Decision Making last updated April 5, 2008

Shell script to read 3 numbers and find the greaters of the three

in Categories Shell Math last updated April 4, 2008