AIX's "bc" Command: Doing a Conditional Expression?
Hello All,
I'm trying to issue a conditional expression using "bc" on floating point numbers. I had this working on my linux box,
but as soon as I transferred the file over to an AIX Server, it would not work anymore...
This is the "WORKING" command on linux (below), which I can't seem to figure out how to do on AIX's Version of "bc". I've read
the manpage which didn't have a very good explaination for it, except that, I believe the ONLY way you can use those
relational operators is in an if|for|while statements/loops...
So I think I have to somehow convert this to a "bc" If Statement.
Anyone know how this is done?
Ok, basically yes...
For the expression below, $size COULD possibly be a floating point number, OR it could be a '0'. And since I'm writing this in a
shell script I can't exactly use a float in a Shell If Statement.
And for what I'm looking for as output, I really just need 0|1 (i.e. TRUE or FALSE) result.
Ok, tried your "bc" example, but I got an error...
I'm pretty sure I need to somehow do this in a "If Statement" in the bc command. I just can't figure out the syntax.
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi, everyone.
I need to write a program to get io info based on libperfstat.
But the "write time" of a disk is just half of the value get from iostat.
I'm confused and can't explain. Help please.
How I calculate "write service time per sec":
In iostat:
write service... (0 Replies)
Hello,
I am reading one of the AIX manuals about shell scripting and (AIX 5) and I found this example when introducing to functions:
function usage
{
prog="$1"; shift
print -u2 "$prog: usage: $prog $@"
exit 1
}
This example is meant to be easy but I don't understand what it is... (5 Replies)
Hello All,
I am running source command on my project configuration file app.cfg which has conditional statements with make file systax E.g ifeq ($(APP_CMP_DIR),trunk).
When I source this file it throws error: syntax error near unexpected token... (1 Reply)
Hello All,
I have something like below
LDC100/rel/prod/libinactrl.a
LAA2000/rel/prod/libinactrl.a
I want to remove till first forward slash that is outputshould be as below
rel/prod/libinactrl.a
rel/prod/libinactrl.a
How can I do that ??? (8 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I have 2000 files named like "file-fr0000.log", "file-fr1999.log"...
I wanna generate the file names automatically in the following c shell script:
set fr = 0
while ($fr <= 1999)
grep "ENERGY" file-fr$fr.log > data.dat
@ fr = ( $fr + 1 )
end
The above will generate file names... (3 Replies)