Linux Operating System (MOSC)

MOSC Banner

shell script

edited Dec 12, 2013 11:39PM in Linux Operating System (MOSC) 3 commentsAnswered ✓
Hi ,
I want to prepare one shell script which will display the available space,size,used  of a filesystem (ex. /u01) along with the host name . i tried with the below command . but o/p is showing hostname 2 times.


$  df -hP /u01| awk -v d="$(hostname -s)" '{ print d " " $2 " " $3 " " $4 " " $6}'
xdhost1pp01 Size Used Avail Mounted
xdhost1pp01 99G 50G 44G /u01
$

o/p  should be like this . can you help me here....

NODE NAME  Size  Used   Avail   Mounted
xdhost1pp01  99G  50G    44G    /u01


Regards,
Ani

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center