Sponsored Content
Full Discussion: AWK equation evaluation.
Top Forums Shell Programming and Scripting AWK equation evaluation. Post 302146821 by drl on Thursday 22nd of November 2007 10:20:39 AM
Old 11-22-2007
Hi.

Many interpreted languages have an eval feature, e.g. snobol, perl,.

I don't know of one for awk, but I'd be happy to learn of one ... cheers, drl
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

equation calculation on Unix

Hay, guys, Any ideas how to calculate like this: in first file, there're number of lines listing 2+3, 6*9 ....... Then, how to get the result and put them in another file in format: 2+3 5 6*9 54 ...... sheerly by shell command, no scripts required. (4 Replies)
Discussion started by: robbinGlasses
4 Replies

2. Shell Programming and Scripting

Perl - maths equation - need help

if input to the perl program is ' ( p * ((a+b) * (c+d))) + q ' it shuld give the output as ' pac + pad + pbc + pbd + q ' .can anyone suggest a way to do this ? (7 Replies)
Discussion started by: Anuj8584
7 Replies

3. High Performance Computing

Performance Equation

I'm running a MPI program using a cluster of 4 machines(different machines of different processing power,cpu utilization etc.). I'm trying to balance the computation among the machine to get the minimum execution time for that. I tried to balance it by creating a threshold value by taking the load... (1 Reply)
Discussion started by: chamila1986
1 Replies

4. Shell Programming and Scripting

Using AWK in IF evaluation in KSH

Hi - I have an expression that evaluates to "Alive" or some other condition. e.g. if I run :- awk -F \| '{gsub(/]*/,"",$4); print $4 }' then the output is "Alive". I want to be able to test this as the result may be some other condition other than "Alive". I have tried the following... (4 Replies)
Discussion started by: sniper57
4 Replies

5. UNIX for Dummies Questions & Answers

cp command evaluation

Hi all! I'm writting one script to copy a file in various folders, but there are 2 things to validate. First that the folder where i'll be cpying exists, and second that i have permissions to copy the file in it. so far i have found the way to validate the folder exists, but when trying to... (6 Replies)
Discussion started by: feliperivera
6 Replies

6. Shell Programming and Scripting

Help with insert a value equation in bash script

HI All, I have a script in bash that i want that script will perform action When the size of a particular folder exceeds the 80%. Here is an example of script that result is exactly 80% : #!/bin/bash CHECK=$(df -h /var/log/syslog | grep '80%' | xargs echo | cut -d' ' -f5) if ];... (1 Reply)
Discussion started by: Aviel.shani
1 Replies

7. Homework & Coursework Questions

Solving heat equation using crank-nicolsan scheme in FORTRAN

! The one-dimensional PDE for heat diffusion equation ! u_t=(D(u)u_x)_x + s where u(x,t) is the temperature, ! D(u) is the diffusivity and s(x,t) is a source term. ! Taking D(u)= 1 and s(x,t)=0 gives ! u_t= u_xx ! uniform one dimensional region |x|<1 for t>0 ! uniform mesh size delta x=0.1 !... (1 Reply)
Discussion started by: watto1
1 Replies

8. Programming

E**(i*pi)=-1 or e**(j*pi)=-1, something I found out in Python using part of Eulers Identit equation.

Well guys and gals I have discovered after all these years that Python does complex numbers without the 'complex()' function or 'cmath' import. It is well known that Euler's Identity E**(i*pi)+1=0 so I decided to experiment Last login: Fri Dec 13 18:27:30 on ttys000 AMIGA:amiga~> python3.8... (0 Replies)
Discussion started by: wisecracker
0 Replies
install::TempContent::Objects::mod_perl-2.0.9::docs::apiUserdContributedinstall::TempContent::Objects::mod_perl-2.0.9::docs::api::ModPerl::Util(3)

NAME
ModPerl::Util - Helper mod_perl Functions Synopsis use ModPerl::Util; # e.g. PerlResponseHandler $callback = ModPerl::Util::current_callback; # exit w/o killing the interpreter ModPerl::Util::exit(); # untaint a string (do not use it! see the doc) ModPerl::Util::untaint($string); # removes a stash (.so, %INC{$stash}, etc.) as best as it can ModPerl::Util::unload_package($stash); # current perl's address (0x92ac760 or 0x0 under non-threaded perl) ModPerl::Util::current_perl_id(); Description "ModPerl::Util" provides mod_perl utilities API. API
"ModPerl::Util" provides the following functions and/or methods: "current_callback" Returns the currently running callback name, e.g. 'PerlResponseHandler'. $callback = ModPerl::Util::current_callback(); ret: $callback ( string ) since: 2.0.00 "current_perl_id" Return the memory address of the perl interpreter $perl_id = ModPerl::Util::current_perl_id(); ret: $perl_id ( string ) Under threaded perl returns something like: 0x92ac760 Under non-thread perl returns 0x0 since: 2.0.00 Mainly useful for debugging applications running under threaded-perl. "exit" Terminate the request, but not the current process (or not the current Perl interpreter with threaded mpms). ModPerl::Util::exit($status); opt arg1: $status ( integer ) The exit status, which as of this writing is ignored. (it's accepted to be compatible with the core "exit" function.) ret: no return value since: 2.0.00 Normally you will use the plain "exit()" in your code. You don't need to use "ModPerl::Util::exit" explicitly, since mod_perl overrides "exit()" by setting "CORE::GLOBAL::exit" to "ModPerl::Util::exit". Only if you redefine "CORE::GLOBAL::exit" once mod_perl is running, you may want to use this function. The original "exit()" is still available via "CORE::exit()". "ModPerl::Util::exit" is implemented as a special "die()" call, therefore if you call it inside "eval BLOCK" or "eval "STRING"", while an exception is being thrown, it is caught by "eval". For example: exit; print "Still running"; will not print anything. But: eval { exit; } print "Still running"; will print Still running. So you either need to check whether the exception is specific to "exit" and call "exit()" again: use ModPerl::Const -compile => 'EXIT'; eval { exit; } exit if $@ && ref $@ eq 'APR::Error' && $@ == ModPerl::EXIT; print "Still running"; or use "CORE::exit()": eval { CORE::exit; } print "Still running"; and nothing will be printed. The problem with the latter is the current process (or a Perl Interpreter) will be killed; something that you really want to avoid under mod_perl. "unload_package" Unloads a stash from the current Perl interpreter in the safest way possible. ModPerl::Util::unload_package($stash); arg1: $stash ( string ) The Perl stash to unload. e.g. "MyApache2::MyData". ret: no return value since: 2.0.00 Unloading a Perl stash (package) is a complicated business. This function tries very hard to do the right thing. After calling this function, it should be safe to "use()" a new version of the module that loads the wiped package. References to stash elements (functions, variables, etc.) taken from outside the unloaded package will still be valid. This function may wipe off things loaded by other modules, if the latter have inserted things into the $stash it was told to unload. If a stash had a corresponding XS shared object (.so) loaded it will be unloaded as well. If the stash had a corresponding entry in %INC, it will be removed from there. "unload_package()" takes care to leave sub-stashes intact while deleting the requested stash. So for example if "CGI" and "CGI::Carp" are loaded, calling "unload_package('CGI')" won't affect "CGI::Carp". "untaint" Untaint the variable, by turning its tainted SV flag off (used internally). ModPerl::Util::untaint($tainted_var); arg1: $tainted_var (scalar) ret: no return value $tainted_var is untainted. since: 2.0.00 Do not use this function unless you know what you are doing. To learn how to properly untaint variables refer to the perlsec manpage. See Also mod_perl 2.0 documentation. Copyright mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. Authors The mod_perl development team and numerous contributors. perl v5.18.2 2015install::TempContent::Objects::mod_perl-2.0.9::docs::api::ModPerl::Util(3)
All times are GMT -4. The time now is 02:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy