Search Results

Search: Posts Made By: maskot
Forum: Red Hat 05-31-2007
7,959
Posted By maskot
answer
Doesnt seems like many of you very intressdid in this thread.
Anyway i come up with an solution of it happends to have the same problem.

Under %post in your kickstart server config:
#!/bin/sh...
Forum: Red Hat 05-31-2007
7,959
Posted By maskot
follow up
first of all i am aware of that /etc/hosts dont contain the actually ip adress but hostname, its an example.

Another way to solve this problem is to set variables i guess...

#!/bin/sh
touch...
Forum: Red Hat 05-31-2007
7,959
Posted By maskot
answer
You dont have to know the answer, more or less i want to know if it is possible.
But if you got any tip on HOW TO i wouldnt cry either :)
Forum: Red Hat 05-31-2007
7,959
Posted By maskot
kickstart output/input
Hello Linux gurus!

Ive got a RedHat EnterP. 4 kickstart server that is also running RedHat EnterP 4.
It is working as i should and no problem at all.
However, now i want to run a little script...
2
1,701
Posted By maskot
sorted
Got it sorted but thank you anyway!

Indeed your tip work.
2
1,701
Posted By maskot
Loop
Hello there!

I dont seem to get a loop to work with this code, it simple refuse.
Any kind of help would be very much appreciated, got deadline today.

I need to cut out first 3 letters and...
1,738
Posted By maskot
loop problem
Got a problem with a loop that do this for each line:
a=$(( cost + $( awk ' { print $2 } ' file) ))
awk ' $2 ~ "^[0-9]" && $2 > 0 {$2='$a';print} ' file

#!/bin/sh
cost=30
for, until, while? ...
1,897
Posted By maskot
Got it to work
Thank you for the help mate.

Got it to work like this:
cost=30
a=$(( cost + $( cut -c23-26 5) ))
echo $a
1,897
Posted By maskot
Thank you
It does work if the f2 is actually on field 2 but its is on field 23 so to speak.
File do look like this:
Col10 51 Col23 11

...
1,897
Posted By maskot
guess the fault :)
I really cant understand whats wrong with this:

File looks like this:
55 11

Code:
cost=30
a= cut -c9-12 File
let a=${a}+${cost}
echo $a

The answer echo should echo 11+30(cost)...
3,471
Posted By maskot
thank you
Thank you Anbu23
It helped me, alot!

awk ' $2 ~ "^[0-9]" && $2 > 0 {$2=20;print} ' file

This worked when i removed +$
3,471
Posted By maskot
Thank you for the answer. It seems to work but...
Thank you for the answer.
It seems to work but to the actually file....

I get no output at all to the actually file but if i do a file like the example it works..
The actually file looks like...
3,471
Posted By maskot
work
This seems to work so far:

awk ' /[0-9]/ {print} ' file | awk '$2 > 0 {$2=20;}{print}'

However the file also contains words in the end of the file.
Bla BLA
10 11
11 25
12 30
13 25...
3,471
Posted By maskot
awk and regular expression
Ive got a file with words and also numbers.
Bla BLA
10 10
11 29
12 89
13 ...
1,801
Posted By maskot
Sweet
Thank you for the answers!

Didnt had much time when i wrote the thread ill try to explain a bit further.

First of all COST doesnt have to be 10, it can change.
Second it isnt actually the 3rd...
1,801
Posted By maskot
Little bit of a help or just a tip
I am about to do a script that change the COST so i dont need to change each cost.
The output looks like this.
"OL_ID OL_LINK_COST

----------- ------------

51 10

...
65,987
Posted By maskot
how to run a shellscript
./scriptname

lets say the scriptname is test.sh

then type
./test.sh
18,848
Posted By maskot
another way
Thanks for all answers, it helped alot.


Also just came up with another solotion could maybe come to hand as other users can read this thread as for help.
Its not compiled but it is a solotion...
18,848
Posted By maskot
answer
could this be the answer:
cut -c1-2 filename | cut f2" "-c1-2 filename

Very insecure of the second cut, f2 one.
However if this is the solution i still need them to become variables somehow or...
18,848
Posted By maskot
sed, grep, cut or combine?
I am a beginner at shell scripting, actually i am working on my first script right now.
Anyway i have searched the world how to grep two letters from each word (it will always just be two words).
...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy