Sponsored Content
Full Discussion: my system configuration
Top Forums Shell Programming and Scripting my system configuration Post 302557600 by ygemici on Wednesday 21st of September 2011 04:48:47 PM
Old 09-21-2011
I could not look all of script but i can say something as far as I look over.Smilie

Code:
RamInSystem=`echo \`dmidecode --type 17 | grep "Size" | grep "MB" |awk '{print $2}'\``
RamInSystem=`dmidecode --type 17 | grep " MB" |awk '{s+=$2}END{print s}'`

Code:
RAM_total_cut=`echo $RamInSystem | awk '{print $1+$2+$3+$4+$5}'| awk '{print $1 / 1000}' | bc | cut -d. -f1`
RAM_total_cut=`echo $RamInSystem|awk '{if ($1>999){x=$1/1000;split(x,a,".");print a[1]} else {print "."$1}}'`

Code:
if [ $RamMulByTwo -le $swapInstalled_cut ]; then
swapOkOrNot=`echo "Yes"`
else
swapOkOrNot=`echo "No. Atleast $RamMulByTwo GB should be there"`
fi
echo|awk -v c=$RamMulByTwo -v d=$Installed_cut '{if (c<=d) printf "%s\n","Yes";else printf "%s\n","No. Atleast $RamMulByTwo GB should be there"}'

Code:
RAM_total_used=`free -m 2>&1 | awk '{print $3}' | head -2 | tail -1`" MB"
RAM_total_used=`free -m 2>&1 | awk 'NR==2 {print $3" MB"}'`

Code:
countRams=`echo $RamInSystem | wc -w`
countRams=`dmidecode --type 17 | grep " MB"|awk 'END{print NR}'`

regards
ygemici
This User Gave Thanks to ygemici For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to the configuration of the system

How to know configuration information of the system. like (1) memory assigned for RAM - ? (2) How much is the Hard disk -? (3) processor I used uname and du -k commands. But i couldn't get information about RAM. which command gives this info (3 Replies)
Discussion started by: ds_sastry
3 Replies

2. UNIX for Dummies Questions & Answers

System boot configuration

On my PC I have two hard disks, the first with Windows 98 SE and the second with Linux Mandrake 8.0 (Traktopel). When I have installed Linux, it has modified the boot record of the 1st HD and it has added a graphic menu (LILO) for selecting the OS to use. By default, if I don't press a key, Linux... (2 Replies)
Discussion started by: robotronic
2 Replies

3. UNIX for Dummies Questions & Answers

Gathering system configuration

Hi there, I have been asked to write a script that gathers enough information on our Sun Solaris machines to be able to rebuild and configure them if they should go pop. My question is does anybody have any suggestions on the files that I need to take a copy of, to ensure that everything is... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

4. Shell Programming and Scripting

System Configuration Extraction

Hi All, Im trying to extract a bunch of systems configuration. I have created a file called data.txt and used the below scripts to run extraction of data. Content of data.txt: /etc/passwd /etc/shadow /etc/cron.allow On the Linux terminal, I entered the following commands to execute my... (4 Replies)
Discussion started by: nerd
4 Replies

5. UNIX for Advanced & Expert Users

Script to get system configuration

Hi, We have >1000 UNIX boxes in our environment with various UNIX flavors like Solaris, HP-UX and Redhat Linux ES 3/4/5. We need to collect their system configuration like - No. of CPUs and their frequencies - RAM Size - No. of HDDs installed and their usage - Exact OS Version and its... (3 Replies)
Discussion started by: prvnrk
3 Replies

6. Shell Programming and Scripting

To check the system configuration on Sun solaris

Hi, Could you pls. let me know what is cammand in unix to check the system configuration on Sun solaris. Thanks in advance. Cheers (2 Replies)
Discussion started by: krackjack
2 Replies

7. Solaris

system configuration

how to identify if the machine is sun4u ? is this model a sun4u machine ? Model : Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 300MHz), (2 Replies)
Discussion started by: sudhiroracle
2 Replies

8. Shell Programming and Scripting

Wich tool for check that two system have the same configuration

Hello , On a couple of system I have to check that systems have the same configuration. This system are part of manual cluster but when application are going to switch from one side to another side I would like to be sure I am not going to experience incidents. It is why I wonder if on the web... (2 Replies)
Discussion started by: xavier38450
2 Replies
set_color(1)                                                           fish                                                           set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy