Tag Archives: script

Recursively replacing a string in all files in a directory

You can use the following command to change Specific string on all files under specific directory: find /u01/directory -type f | xargs perl -pi~ -e ‘s/oldtext/newtext/g;’ Tested on Linux & AIX Ref: https://blogs.oracle.com/rammenon/recursively-replacing-a-string-in-all-files-in-a-directory-linux

Shell Script Quick Sheet

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 … Continue reading

Script to list disks Info

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:

how to see hidden char in file

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:

Shell Script for Leap Year

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 … Continue reading

How to make the System Ring

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

Script to list all LPARs on all Managed Systems Connected to HMC

if you have Many Managed Systems connected to HMC and you need to list ALL LPARs that you have on a table view like the following output: —————————– Server Name : Server-****-***-*** ———— LPAR Name          LPAR Number   IP Address TEST1       … Continue reading

how to know the volume group of specified logical volume

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