How 2 Know
If you can't Google it, You Can Knowing it.

Posts Tagged ‘shell’

Shell Script Quick Sheet

Sunday, September 3rd, 2017

The following link containing a quick sheet to start on Shell Script:

shell-quicksheet

The Sheet has the following outline:
Variables
Relational operators
Pattern matching
Functions
Shell math
Test conditions
Flow control
Sample snippets
Special variables
Conditional commands
Trapping signals
Output redirection
Variable substitution

Continue Reading…

Script to list disks Info

Sunday, August 20th, 2017

Hello Everybody,

The following lines are a for loop script to display disks info @ AIX System (Disk Name, Disk Unique ID, Disk Size in MB) and of course you can customize the data by add more columns:

Continue Reading…

how to see hidden char in file

Wednesday, October 9th, 2013

some times you transfer files from windows to Linux or UNIX using binary method, you will find some hidden characters  on the file, to display these hidden character  use commands “cat” with option “vte” see the following examples:

Continue Reading…

Shell Script for Leap Year

Tuesday, July 30th, 2013

Hello every body,
i have below a nice script to tell year the year is Leap or NOT.just copy the following line into a new file name it leap.ksh

# Shell program to read any year and find whether leap year or not
# -----------------------------------------------
# Copyright (c) 2005 nixCraft project 
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
# store year
yy=0
isleap="false"
#echo -n "Enter year (yyyy) : "
#read yy
yy=$1
# find out if it is a leap year or not
if [ $((yy % 4)) -ne 0 ] ; then
   : #  not a leap year : means do nothing and use old value of isleap
elif [ $((yy % 400)) -eq 0 ] ; then
   # yes, it's a leap year
   isleap="true"
elif [ $((yy % 100)) -eq 0 ] ; then
   : # not a leap year do nothing and use old value of isleap
else
   # it is a leap year
   isleap="true"
fi
if [ "$isleap" == "true" ];
then
   echo "YES"
else
   echo "NOT"
fi

Continue Reading…

How to make the System Ring

Sunday, July 28th, 2013

if you are a Shell Scripting Developer and all the time deveolpe Shell Scripts, if course you need to make your System Ring after finished the script or when it needs data from the user.

try this code on AIX
Continue Reading…

how to know the volume group of specified logical volume

Monday, May 27th, 2013

if you need to know the volume group of specified logical volume(AIX System with HACMP), you can run the following command :

#/usr/es/sbin/cluster/utilities/clgetvg -l hd5
rootvg

Continue Reading…