Search Results

Search: Posts Made By: haaru
4,836
Posted By haaru
Actually I altered the script to just use one AWK...
Actually I altered the script to just use one AWK statement as "Corona688" suggested. It now looks like this (also corrected a bug):


#!/bin/ksh
PATH=/usr/bin:/usr/sbin:/sbin; export PATH...
4,836
Posted By haaru
Variable scope in bash
Hello! Before you "bash" me with
- Not another post of this kind
Please read on and you will understand my problem...

I am using the below to extract a sum of the diskIO on a Solaris server.
...
8,396
Posted By haaru
Doh! Using the $Line itself, dunno why it...
Doh!

Using the $Line itself, dunno why it escaped me this easily! :embarassed:


Thanks a lot Dr ;)
8,396
Posted By haaru
Awk command in while loop
Hello!

I've got a loop in which I am processing a list of values gotten through a file with read command.

It seems that instead of processing the lines (values) one by one, I process them all...
5,777
Posted By haaru
I havent tested it but try: ...
I havent tested it but try:



RES=$(ps -e | grep $1 | awk '{print $1}')

#This checks if the result of the command is not null
if [ -n "$RES"]; then
kill $RES
fi


You can...
70,791
Posted By haaru
If I understand correctly and you are trying to...
If I understand correctly and you are trying to redirect the query results to a text file then you can try something like this:


sqlplus -s user/pass << EOF
SPOOL /Myoutputdir/myfile.txt...
3,934
Posted By haaru
You can schedule it in crontab so that the script...
You can schedule it in crontab so that the script runs every minute or so. Do a

man crontab

to see how it works.

As far as the 'not sending sms with error continually' you can have your...
3,934
Posted By haaru
ping -n 3 -i IP_ADDRESS Check in: man...
ping -n 3 -i IP_ADDRESS

Check in:

man ping
7,231
Posted By haaru
No worries steviefordi! I think that this...
No worries steviefordi!

I think that this is getting somewhere now..


while read -r EachLine2
do
RESULT="$(grep "$EachLine2" "$DATA_DIR"/cells*.dat | cut -d, -f2)"
echo...
7,231
Posted By haaru
Can't use that loop for some reason... I get ...
Can't use that loop for some reason... I get


for ((i=1;i<=$LC;i++))
do
sed -n -e "$i"p cells_$1.txt
done


Syntax error at line 35 : `((' is not expected.
7,231
Posted By haaru
Using the following code, given by Corona688: ...
Using the following code, given by Corona688:


while true
do
EachLine2=""
read EachLine2
[ -z "${EachLine3}" ] && break

RESULT="$(grep "$EachLine3"...
7,231
Posted By haaru
Sorry for not being clear on this. Yes, I am...
Sorry for not being clear on this. Yes, I am using bash.



It is 0.


I still believe that the problem is, read recognizing empty rows as the end of file and I can't seem to get it to...
7,231
Posted By haaru
Hey Corona! Thank you for your prompt...
Hey Corona!

Thank you for your prompt respose. Unfortunately I was out of country for the weekend and couldn't test your code and reply.

Anyway, the code produces almost the same results. Now...
7,231
Posted By haaru
While loop seems to exit when blank line is met
Hello everyone!

I am having an issue with a script I am trying to create.

I have an input file (named sort_$1.txt) like:


aaaa
bbbb
cccc

dddd
eeee


and I process it with the...
Showing results 1 to 14 of 14

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