Search Results

Showing results 1 to 40 of 68
Search took 0.01 seconds.
Search: Posts Made By: chris5126 ; Forum: Shell Scripting and child forums
Forum: Shell Scripting Sep 24th, 2009
Replies: 6
Views: 611
Posted By chris5126
nice bit of a hack but seems to work ta very much! only fault is it adds two new lines after every service but I will strip those out with sed!
Forum: Shell Scripting Sep 24th, 2009
Replies: 6
Views: 611
Posted By chris5126
Cool one last thing! It didnt remove the record seperator for the first record so when I run the code you gave I get definedefine for the first record example below. Any help?:


definedefine...
Forum: Shell Scripting Sep 24th, 2009
Replies: 6
Views: 611
Posted By chris5126
hi,

That also removes the word define from every other serivce e.g:

before

define service{
notification_interval 30
check_period 24x7
notification_options c
Forum: Shell Scripting Sep 23rd, 2009
Replies: 6
Views: 611
Posted By chris5126
Hi Guys,

I have a file with lots of similar records example shown at end, I want to be able to delete one of the records and have the following line of code which finds the record I need to...
Forum: Shell Scripting Aug 19th, 2009
Replies: 5
Solved: date command
Views: 566
Posted By chris5126
I have worked it out have used:

`date +"%Y.%m.%d.%H%M"`

Instead of date -u
Forum: Shell Scripting Aug 19th, 2009
Replies: 5
Solved: date command
Views: 566
Posted By chris5126
hi,

But why does the date command give me the correct date then when I try and use the date -u command does it suddenly consider day light savings?
Forum: Shell Scripting Aug 19th, 2009
Replies: 5
Solved: date command
Views: 566
Posted By chris5126
HI Guys,

Prob a very simple one but im stumped, I run the following command and get:


date
Wednesday, 19 August 2009 09:20:59 BST

But when I run
Forum: Shell Scripting Mar 24th, 2009
Replies: 11
Solved: turn mb to gb!
Views: 1,608
Posted By chris5126
hi,

I did notice the typo but even with it changed to % it still doesnt work the exact command im trying is :


root@testbench2:/tmp #echo "1.2GB" | awk '{print sprintf("%8.2f",$1)}'
0.00...
Forum: Shell Scripting Mar 20th, 2009
Replies: 11
Solved: turn mb to gb!
Views: 1,608
Posted By chris5126
hi,

Just tried that from the command line and I still get 0.00! any ideas what could be doing it?
Forum: Shell Scripting Mar 20th, 2009
Replies: 11
Solved: turn mb to gb!
Views: 1,608
Posted By chris5126
Hi,

To test it I was simply placing the data into a file in /tmp/datafile then the scripts looks like the following its also run from temp

#!/bin/ksh
awk '/s/ {
if ( index($2, "GB") )...
Forum: Shell Scripting Mar 20th, 2009
Replies: 11
Solved: turn mb to gb!
Views: 1,608
Posted By chris5126
Hi,

I get the following output:


d15 0.00 c1t0d0s5
d13 0.00 c1t0d0s3
d11 0.00 c1t0d0s1
d10 0.00 c1t0d0s0
d25 0.00 c1t1d0s5
Forum: Shell Scripting Mar 18th, 2009
Replies: 4
Views: 1,173
Posted By chris5126
yes I tired that but could only get the ouput to follow one line after the other and not stay in the columns can you give me the code please?
Forum: Shell Scripting Mar 18th, 2009
Replies: 4
Views: 1,173
Posted By chris5126
Hi I have a command that produces the following:

/usr/ucb/ps -auxxx|awk '{print $3,$4,$2,$1,$11}'|grep -v 0.0
%CPU %MEM PID USER COMMAND
0.2 5.217405286920 1910 noaccess
0.1 0.1 180 root 0:43...
Forum: Shell Scripting Mar 18th, 2009
Replies: 11
Solved: turn mb to gb!
Views: 1,608
Posted By chris5126
can no one help??
Forum: Shell Scripting Mar 8th, 2009
Replies: 11
Solved: turn mb to gb!
Views: 1,608
Posted By chris5126
hi,

i am totally stuck i need a script (that works in ksh under solaris 10) that takes the following output

d15 509MB c1t0d0s5
d13 7.0GB c1t0d0s3
d11 1.5GB c1t0d0s1
d10 10GB c1t0d0s0
d25...
Forum: Shell Scripting Feb 27th, 2009
Replies: 4
Views: 1,450
Posted By chris5126
Hi,

1.2 MB would be fine and all values will only be to two decimal places, but yes the human readable output is normally off by a few kb but for what i need it for its accurate enough. If that...
Forum: Shell Scripting Feb 26th, 2009
Replies: 4
Views: 1,450
Posted By chris5126
Hi,

i worked out using iostat -En is the best way. However now im left with vaules in GB or/and MB so i need to get these into a standard form. I know i can use awk but im rubbish at it.
Maybe...
Forum: Shell Scripting Feb 25th, 2009
Replies: 4
Views: 1,450
Posted By chris5126
Hi,

I am writing a script to get information on disks for Solaris 10, does anyone know of a way to print out the size of each disk on the system in MB i know how to get it in GB and could do some...
Forum: Shell Scripting Feb 12th, 2009
Replies: 9
Views: 1,209
Posted By chris5126
Thought so just wanted to make sure it wasnt an error code from awk!! ta very much
Forum: Shell Scripting Feb 10th, 2009
Replies: 9
Views: 1,209
Posted By chris5126
HI,

Got the code working but the results look a little wierd heres the code:


kstat -p -c net -n $Interface 1 3 | egrep\
'snap|rbytes64|obytes64|ifspeed' |tail -7 | awk '{print $2,$3}' >...
Forum: Shell Scripting Jan 24th, 2009
Replies: 9
Views: 1,209
Posted By chris5126
Hi,

I understand ksh-93 does support float but it is not an option to use this. How would I do it with bc, calc, awk or perl?
Forum: Shell Scripting Jan 23rd, 2009
Replies: 9
Views: 1,209
Posted By chris5126
That gives me the following error:

expr: non-numeric argument
expr: non-numeric argument


So you can try it for yourself i have attached the exact code im using:
temp file=/tmp/net_vmxnet0
...
Forum: Shell Scripting Jan 23rd, 2009
Replies: 9
Views: 1,209
Posted By chris5126
HI guys,

I have file with 6 values in:


1060276
2211546
7544.941158316
1060276
2211606
Forum: Shell Scripting Dec 7th, 2008
Replies: 6
Views: 1,309
Posted By chris5126
haha i was trying to put the value into a varailble and was getting frusturtated and trying different things! thanks for your help!
Forum: Shell Scripting Dec 7th, 2008
Replies: 6
Views: 1,309
Posted By chris5126
ok not to familar with awk had a little play but getting errors. So if i wanted to manipluate the varialbes and then put them into the new varialbles read and write how would i do it. Also would be...
Forum: Shell Scripting Dec 7th, 2008
Replies: 6
Views: 1,309
Posted By chris5126
Hi guys,

Will keep this short and sweet. Trying to do integer devision to *decimial places but i dont think the version of ksh installed on solaris 10 supports this as they would need to be...
Forum: Shell Scripting Nov 21st, 2008
Replies: 9
Views: 1,347
Posted By chris5126
ok but this definatly needs to be changed:

#! /bin/bash

As it sets the file descriptor of the file and if you keep the space it wont reconsie it as a bash file!
Forum: Shell Scripting Nov 20th, 2008
Replies: 9
Views: 1,347
Posted By chris5126
Forum: Shell Scripting Nov 20th, 2008
Replies: 9
Views: 1,347
Posted By chris5126
Also instead of this:
while read inputline
do
copydate="$inputline"
echo "you entered $copydate";

Why dont you just use

while read coypdate
do
Forum: Shell Scripting Nov 20th, 2008
Replies: 9
Views: 1,347
Posted By chris5126
Hi,

You have some spaces which may be causing you some problems. One here:

#! /bin/bash
should be

#!/bin/bash

and also
Forum: Shell Scripting Nov 20th, 2008
Replies: 4
Views: 746
Posted By chris5126
Are you sure that it isnt working it will run the script but pull any output back to the server you are working on. Put a large sleep in the script then log on to the server that your running the...
Forum: Shell Scripting Nov 13th, 2008
Replies: 4
Views: 782
Posted By chris5126
lol sorry just have seen very similar if not exactly the same problem before!! Look through this forum and you should find the answer somewhere.
Forum: Shell Scripting Nov 13th, 2008
Replies: 4
Views: 782
Posted By chris5126
sounds like homework to me!! You had a go at it at all. You should try man sed.
Forum: Shell Scripting Nov 13th, 2008
Replies: 1
Views: 519
Posted By chris5126
I would look at awk and grep and wc.

Awk will print out columns of a file so try.

cat filename | awk '{print $1}'
You can change $1 to any number to print out the different columns.

You...
Forum: Shell Scripting Nov 6th, 2008
Replies: 3
Views: 645
Posted By chris5126
Ot create a file and pipe something into it whatever you like you can use the redirect to a file


echo "hello" > /tmp/temp.txt

This will open a new file or overwrite an existing file in the...
Forum: Shell Scripting Nov 5th, 2008
Replies: 3
Views: 691
Posted By chris5126
Hi John,

What do you mean your question doesnt make much sense!
Forum: Shell Scripting Nov 5th, 2008
Replies: 1
Views: 885
Posted By chris5126
Hi guys,

i have a ksh script that gets some info on processes and puts it into a temp file:


/usr/ucb/ps -auxxx|awk '{print $3," "$4," "$2," "$1," "$11}'|grep -v 0.0|sed 1d > $TMP


It gets...
Forum: Shell Scripting Oct 30th, 2008
Replies: 2
Views: 1,291
Posted By chris5126
got it!

/usr/ucb/ps -aux | awk '{print $3,$2,$1,$11}' | grep -v 0.0 | sed 1d

This shows a list of the processes taking up cpu time in the format %cpu PID user command if anyone is interested!!
Forum: Shell Scripting Oct 29th, 2008
Replies: 2
Views: 1,291
Posted By chris5126
please note i cant use top or prstat i need something i can use within a shell script!
Forum: Shell Scripting Oct 29th, 2008
Replies: 2
Views: 1,291
Posted By chris5126
Hi guys,

I need a command on solaris 10 to show how much cpu is bein used in % terms but more specific than sar i need it down to 0.0% if that makes sense.

Basically im tryin to find out how...
Showing results 1 to 40 of 68

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC