Sponsored Content
Full Discussion: G/AWK and ksh troubles
Top Forums Shell Programming and Scripting G/AWK and ksh troubles Post 302580522 by Chubler_XL on Thursday 8th of December 2011 06:51:00 PM
Old 12-08-2011
It should be close to 5 times faster. With the existing code you keep subtracting the Unit Cell value until the coordinates is within range (10 to 20) separate subtractions.

The updated code uses the modulo function (%) to calculate the remainder after dividing by the Unit Cell Value. So basically it one or two division operations instead of lots of subtract or add operations.

The if-then-else operator <expr>?<true value>:<false value> deals with the border conditions (e.g. negative values wrapping to positive and edge values ending up as either zero or the Unit Cell value).

$1 is different to $2 and $3 because in your original code you have a > test for $1 and >= for $2 and $3
 

10 More Discussions You Might Find Interesting

1. Programming

compiling troubles

i keep getting the following error with the code segment below when i try to compile the program. The code is from 'defs.h' parse error before '(' parse error before ')' stray '\' in program this is the code segment and the error is on the second line of the segment #define... (1 Reply)
Discussion started by: token
1 Replies

2. UNIX for Dummies Questions & Answers

compariosn troubles...

Hi Guys, I am trying to compare using if, but keep getting some strange results. if ; then keeps creating the file 1 if ; then does not work at all if ; then does not work if ; then does not work if ; then does not work eihter. I am using a ksh, on Solaris (9 Replies)
Discussion started by: jagannatha
9 Replies

3. Programming

Troubles with HPUX

Hello I created an application in c language for HP-UX operative system,and it runs on a 32 bits PARISC processor. My problem is that I have to run this same application but now in a 64 bits Parisc processor. But I am not able to compile the application with the 64 bit server, and I only could use... (1 Reply)
Discussion started by: masterboy6666
1 Replies

4. UNIX for Dummies Questions & Answers

ssh2 troubles

I'm trying to set up a secure and trusted connection between 2 boxes running solaris using ssh2. I've run ssh-keygen2 on the local box and on the remote box, created the identification file ( IdKey id_dsa_2048_a ) on the local machine and copied across the public key file from the local to... (5 Replies)
Discussion started by: PaulC
5 Replies

5. HP-UX

cron troubles

I have a cronjob that I need to run everyday and it needs to have todays date inputed, here is what I have, but is not working as expected.......... 23 02 * * * cd /path;./RequestSummaryReport.sh $(date +%Y-%m-%d) the output from mail gives me............. Date: Fri, 8 Feb 2008 02:12:07... (4 Replies)
Discussion started by: theninja
4 Replies

6. Shell Programming and Scripting

Encoding troubles

Hello All I have a set of files, each one containing some lines that follows that regex: regex='disabled\,.*\,\".*\"'and here is what file says about each files: file <random file> <random file> ASCII text, with CRLF line terminatorsSo, as an example, here is what a file ("Daffy Duck - The... (3 Replies)
Discussion started by: tukuyomi
3 Replies

7. UNIX for Dummies Questions & Answers

Cron troubles

I am aware this question has been answered time and again. I feel I have tried everything I have seen on the net and really need help to get this working. Same old story. Shell script, working from command but not from cron. I need my script to take values from a .properties file. Tried... (2 Replies)
Discussion started by: airalpha
2 Replies

8. Shell Programming and Scripting

awk and tr troubles

I am trying to make all the fields containing lower case letters upper case and the third field of a file display ** instead. I have this: awk '{printf "%s %s ** %d %d\n", $1, $2, $4, $5}' database.txt | tr '' '' < database.txt And that only changes it to upper case, other... (4 Replies)
Discussion started by: Bungkai
4 Replies

9. UNIX for Advanced & Expert Users

Troubles with OpenSSH

Hi, I am trying to login from one AIX server to another without using a password, a basic configuration, however it doesn't seem to work. All things are in place. I have both a public and private key in the ~/.ssh folder and also have an "authorized_keys" file on the target-server containing... (5 Replies)
Discussion started by: Hille
5 Replies

10. Shell Programming and Scripting

ksh passing to awk multiple dyanamic variables awk -v

Using ksh to call a function which has awk script embedded. It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Discussion started by: highnthemnts
1 Replies
ADUNCORE(1)						      General Commands Manual						       ADUNCORE(1)

NAME
AdunCore - core module of the Adun molecular simulator SYNOPSIS
AdunCore [OPTIONS] DESCRIPTION
This manual page documents briefly the AdunCore command. AdunCore is the core module of the Adun molecular simulator. It is launched automatically from the UL GUI but can be used from the GNU/Linux console as well. Options to AdunCore must be specified as value pairs in the form `-Option Value'. The following options are available: -Template A valid Adun template. This is the only option that is mandatory. -ExternalObjects A dictionary in plist format. Its contents extend the externalObjects section of the template. If there are duplicate keys this dictionary takes precedence. -SimulationOutputDir Directory where simulation data directory will be stored. (Default value: SimulationOutput) -ControllerOutputDir Directory where controller data will be stored. (Default value: ControllerOutput) -CreateLogFiles If YES log files are created. If NO they are not. (Default value: YES) -LogFile File where the program output will be written. (Default value: AdunCore.log) -ErrorFile File where program errors and warnings will be written. (Default value: AdunCore.errors) -RedirectOutput If YES the log files will be moved to the simulation output directory. (Default value: YES) -RunInteractive If YES the simulation loop is spawned as a separate thread. The main thread then enters a run loop and can serve external requests. If NO then interaction is not possible with the simulation. (Default value: NO) -ConnectToAdServer If YES the simulation registers its existance with a local AdServer daemon. This allows the simulation to be viewed and controlled from the Adun GUI. (Default value: NO) SEE ALSO
UL(1), AdunServer(1), GNUstep(7). AUTHOR
AdunServer was written by Michael A. Johnston, I. F. Galvn, Jordi Vill-Freixa, Alexander V. Diemand. This manual page was written by Yavor Doganov <yavor@gnu.org> for the Debian project (but may be used by others). January 19, 2008 ADUNCORE(1)
All times are GMT -4. The time now is 01:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy