Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Merge Static and dynamic parts in variable declaration Post 302436789 by yahyaaa on Tuesday 13th of July 2010 07:07:44 AM
Old 07-13-2010
Merge Static and dynamic parts in variable declaration

Dear Unix experts

Moved from "Shell Programming and Scripting "
I want to define a variable which contains dynmic and static part, daynamic part is the first field.

Sample of data

Code:
dddd aaaa sssss 12345
ssss 2323 234234 4242
dddd 3223 34234 54353
ssss 24234 3434 42342
dddd rwrw 423423 werwer

Code:
Code:
nawk 'BEGIN {FS=" "}{ $1"_subs"=$1"_subs"+1}END {print dddd_subs}'

it should give me 3

but it gives me error "nawk: syntax error at source line 1
context is
Code:
BEGIN {FS=" "}{ >>> $1"_"subs= <<< $1"_"subs+1}
nawk: illegal statement at source line 1"

Can you please help ?
Many thanks in advance

I also tried

Code:
Code:
nawk 'BEGIN {FS=" ";diff[$2]=2}{ subs[$1]=+1}END {print subs[dddd], diff [rwrw]}

, Also error...

Can any one advise how to do it in any of the ways above

Last edited by radoulov; 07-13-2010 at 09:14 AM.. Reason: Additional code tags!
 

10 More Discussions You Might Find Interesting

1. Programming

Variable declaration

what does this mean when a variable is declared as register int i; Thanks. :confused: (2 Replies)
Discussion started by: laila63
2 Replies

2. Programming

differeEEK!nce between static and dynamic linking

hello, friends i would like to know what is the differnce between static library and dynamic library? How will u create them and what are there uses? (1 Reply)
Discussion started by: vijaya2006
1 Replies

3. Solaris

Static & Dynamic IP on the same machine

Hi, I have a SUN SPARC with 2 NICs running Solaris 9. I want to configure the first NIC using static IP and the second NIC using dynamic IP (DHCP client). Anyone help me! Thanks in advanced. Tinh (2 Replies)
Discussion started by: tinhlx
2 Replies

4. Shell Programming and Scripting

Help with variable declaration

I declared a variable x that gets the count(*) from a table. The table name is also defined as a variable. What's wrong with this statment : X=” select count(*) from ${table_name}“ then y = `${X}${table_name}' echo ${y} It throws an error saying count not found. Please... (1 Reply)
Discussion started by: dsravan
1 Replies

5. UNIX for Dummies Questions & Answers

Change static ip to dynamic ip

I had just install a solaris 10 server. I set the ip address to static during installation. I want to change it to dynamic but I don't know how. Expert here please help me! (5 Replies)
Discussion started by: jimmyysk
5 Replies

6. Shell Programming and Scripting

Unix script to segregate dynamic and static content of a web application

I need to deploy a JAVA application on two separate servers: 1. Web server (IBM HTTP Web Servers (IHS)) 2. Application Server (WebSphere Application Server WAS7.0) The static content will have to be deployed and handled on Web server. These would include GIFs, HTML, CSS, etc files.... (0 Replies)
Discussion started by: chani27
0 Replies

7. Shell Programming and Scripting

Merge Static and dynamic parts in variable declaration

Dear Unix experts I want to define a variable which contains dynmic and static part, daynamic part is the first field. Sample of data dddd aaaa sssss 12345 ssss 2323 234234 4242 dddd 3223 34234 54353 ssss 24234 3434 42342 dddd rwrw 423423 werwer nawk 'BEGIN {FS=" "}{... (4 Replies)
Discussion started by: yahyaaa
4 Replies

8. Shell Programming and Scripting

variable declaration

Hi Guys, What does this mean actually ? Can somebody give me any explanation ? x=${x:=1} Thanks (2 Replies)
Discussion started by: amit.behera
2 Replies

9. Programming

Shared, Static , Dynamic?

if I could compile the same source file as shared/static/dynamic what are the advantages/ disadv of each. PS:by dynamic i am asking about usage of "dlopen". How is it particularly diff from shared libs (2 Replies)
Discussion started by: dragonpoint
2 Replies

10. Shell Programming and Scripting

variable declaration

how to check 1. If variable is declared or not 2. If any value if assigned to variable or not. in UNIX shell script (6 Replies)
Discussion started by: ace_friends22
6 Replies
SoCubeDetail(3) 						       Coin							   SoCubeDetail(3)

NAME
SoCubeDetail - The SoCubeDetail class contains information about the parts of a SoCube shape. Instances of this class are used for storing information about hit points on cone geometry after pick operations, and for storing information returned to tessellation callbacks. SYNOPSIS
#include <Inventor/details/SoCubeDetail.h> Inherits SoDetail. Public Member Functions virtual SoType getTypeId (void) const SoCubeDetail (void) virtual ~SoCubeDetail () virtual SoDetail * copy (void) const void setPart (const int part) int getPart (void) const Static Public Member Functions static SoType getClassTypeId (void) static void cleanupClass (void) static void initClass (void) Protected Attributes int part Additional Inherited Members Detailed Description The SoCubeDetail class contains information about the parts of a SoCube shape. Instances of this class are used for storing information about hit points on cone geometry after pick operations, and for storing information returned to tessellation callbacks. The part indices are ordered from 0 to 5 as [ front, back, left, right, top, bottom ]. See also: SoCube, SoRayPickAction, SoCallbackAction Constructor &; Destructor Documentation SoCubeDetail::SoCubeDetail (void) Constructor. SoCubeDetail::~SoCubeDetail () [virtual] Destructor. Member Function Documentation SoType SoCubeDetail::getTypeId (void) const [virtual] Returns the type identification of a detail derived from a class inheriting SoDetail. This is used for run-time type checking and 'downward' casting. Usage example: void fuhbear(SoDetail * detail) { if (detail->getTypeId() == SoFaceDetail::getClassTypeId()) { // safe downward cast, know the type SoFaceDetail * facedetail = (SoFaceDetail *)detail; } return; // ignore if not a SoFaceDetail } For application programmers wanting to extend the library with new detail classes: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre- defined macros available through Inventor/nodes/SoSubDetail.h: SO_DETAIL_SOURCE and SO_DETAIL_INIT_CLASS. Implements SoDetail. SoType SoCubeDetail::getClassTypeId (void) [static] Returns the type for this class. Reimplemented from SoDetail. void SoCubeDetail::initClass (void) [static] Initialize relevant common data for all instances, like the type system. Reimplemented from SoDetail. SoDetail * SoCubeDetail::copy (void) const [virtual] Return a deep copy of ourself. Note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes. Implements SoDetail. void SoCubeDetail::setPart (const intpartarg) Set the part of a cube which was selected. A cube has of course six different conceptual parts -- it's sides. int SoCubeDetail::getPart (void) const Returns selected cube part. Member Data Documentation int SoCubeDetail::part [protected] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoCubeDetail(3)
All times are GMT -4. The time now is 05:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy