Sponsored Content
Top Forums Shell Programming and Scripting Adding "1.123+4.242 = 5" problem Post 302577708 by tommya on Tuesday 29th of November 2011 06:00:49 PM
Old 11-29-2011
Adding "1.123+4.242 = 5" problem

I wan't to add two numbers (e.g 1.123 and 4.242) from different files but the add operation seems to cut the decimals. Any ideas how to convert or rewrite?
(The numbers in the file are in 1.123 and not 1,123)

-------------------
Code:
awk 'NR>9{print $3,$4,$5}' rlx.4000.dump > pos_0
awk 'NR>9{print $3,$4,$5}' rlx.4050.dump > pos_1

paste pos_0 pos_1 | awk '{x0=$1+$4; y0=$2+$5; z0=$3+$6 ; print x1,y0,z0}' > pos_2

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


Tommy

Last edited by Franklin52; 11-30-2011 at 03:15 AM.. Reason: Please use code tags for code and data samples, thank you
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. UNIX and Linux Applications

A question/problem about oracle "tns listener" and "enterprise manager"

hi, I have * an IBM P550 machine, * an AIX 5.3 running on it and * an oracle database, already installed on it. The problem (or question of my own) is: Oracle tns listener, "CT_LISTENER", and the enterprise manager (EM) of the instance, which is uniq instance and called... (0 Replies)
Discussion started by: talipk
0 Replies

4. UNIX for Advanced & Expert Users

A question/problem about oracle "tns listener" and "enterprise manager"

hi, I have a problem about the Oracle related components. I'm not able to find any answer yet, and waiting for your responses... Here is the configuration of my system: * an IBM P550 machine, * an AIX 5.3 running on it and * an oracle database, already installed on it. The problem (or... (1 Reply)
Discussion started by: talipk
1 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

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)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

7. Post Here to Contact Site Administrators and Moderators

Suggestion: adding two new groups "sed" and "awk"

Majority of the questions are pertaining file/string parsing w.r.t sed or awk It would be nice to have these two as their own sub category under shell-programming-scripting which can avoid lot of duplicate posts. (1 Reply)
Discussion started by: jville
1 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

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)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
SCHEDCTL(8)						    BSD System Manager's Manual 					       SCHEDCTL(8)

NAME
schedctl -- control scheduling of processes and threads SYNOPSIS
schedctl [-A cpus] [-C class] [-P pri] [-t lid] -p pid | command DESCRIPTION
The schedctl command can be used to control the scheduling of processes and threads. It also returns information about the current schedul- ing parameters of the process or thread. Only the super-user may change the scheduling parameters. schedctl can also be used to start a new command using the specified parameters. Available options: -A cpus Set of the processors on which process or thread should run, that is, affinity. Processors are defined as numbers (starting from zero) and separated by commas. A value of -1 is used to unset the affinity. -C class Scheduling class (policy), one of: SCHED_OTHER Time-sharing (TS) scheduling policy. The default policy in NetBSD. SCHED_FIFO First in, first out (FIFO) scheduling policy. SCHED_RR Round-robin scheduling policy. -P pri Priority for the process or thread. Value should be in the range from SCHED_PRI_MIN (0) to SCHED_PRI_MAX (63). Setting of prior- ity for the process or thread running at SCHED_OTHER policy is not allowed. -p pid The target process which will be affected. If the process has more than one thread, all of them will be affected. If -p is not given, a command to execute must be given on the command line. -t lid Thread in the specified process. If specified, only this thread in the process will be affected. May only be specified if -p is also given. EXAMPLES
Show scheduling information about the process whose ID is ``123'': # schedctl -p 123 Set the affinity to CPU 0 and CPU 1, policy to SCHED_RR, and priority to 63 for thread whose ID is ``1'' in process whose ID is ``123'': # schedctl -p 123 -t 1 -A 0,1 -C SCHED_RR -P 63 Run the top(1) command with real-time priority: # schedctl -C SCHED_FIFO top SEE ALSO
nice(1), getpriority(2), setpriority(2), psrset(8), renice(8) HISTORY
The schedctl command first appeared in NetBSD 5.0. BSD
March 21, 2011 BSD
All times are GMT -4. The time now is 03:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy