Sponsored Content
Top Forums Shell Programming and Scripting Merge Static and dynamic parts in variable declaration Post 302436470 by yahyaaa on Monday 12th of July 2010 08:03:15 AM
Old 07-12-2010
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

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
BEGIN {FS=";"}{ >>> $1"_"subs= <<< $1"_"subs+1}
nawk: illegal statement at source line 1"

Can you please help ?
Many thanks in advance

---------- Post updated at 07:03 AM ---------- Previous update was at 04:47 AM ----------

I also tried

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

but the results were always 1!!!!
 

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. Emergency UNIX and Linux Support

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 dddd aaaa sssss 12345 ssss 2323 234234 4242 dddd 3223 34234 54353 ssss 24234 3434 42342 dddd rwrw 423423... (2 Replies)
Discussion started by: yahyaaa
2 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
ssss(1) 						      General Commands Manual							   ssss(1)

NAME
ssss - Split and Combine Secrets using Shamir's Secret Sharing Scheme. SYNOPSIS
ssss-split -t threshold -n shares [-w token] [-s level] [-x] [-q] [-Q] [-D] [-v] ssss-combine -t threshold [-x] [-q] [-Q] [-D] [-v] DESCRIPTION
ssss is an implementation of Shamir's Secret Sharing Scheme. The program suite does both: the generation of shares for a known secret, and the reconstruction of a secret using user-provided shares. COMMANDS
ssss-split: prompt the user for a secret and generate a set of corresponding shares. ssss-combine: read in a set of shares and reconstruct the secret. OPTIONS
-t threshold Specify the number of shares necessary to reconstruct the secret. -n shares Specify the number of shares to be generated. -w token Text token to name shares in order to avoid confusion in case one utilizes secret sharing to protect several independent secrets. The generated shares are prefixed by these tokens. -s level Enforce the scheme's security level (in bits). This option implies an upper bound for the length of the shared secret (shorter secrets are padded). Only multiples of 8 in the range from 8 to 1024 are allowed. If this option is ommitted (or the value given is 0) the security level is chosen automatically depending on the secret's length. The security level directly determines the length of the shares. -x Hex mode: use hexadecimal digits in place of ASCII characters for I/O. This is useful if one wants to protect binary data, like block cipher keys. -q Quiet mode: disable all unnecessary output. Useful in scripts. -Q Extra quiet mode: like -q, but also suppress warnings. -D Disable the diffusion layer added in version 0.2. This option is needed when shares are combined that where generated with ssss ver- sion 0.1. -v Print version information. EXAMPLE
In case you want to protect your login password with a set of ten shares in such a way that any three of them can reconstruct the password, you simply run the command ssss-split -t 3 -n 10 -w passwd To reconstruct the password pass three of the generated shares (in any order) to ssss-combine -t 3 NOTES
To protect a secret larger than 1024 bits a hybrid technique has to be applied: encrypt the secret with a block cipher and apply secret sharing to just the key. Among others openssl and gpg can do the encryption part: openssl bf -e < file.plain > file.encrypted gpg -c < file.plain > file.encrypted SECURITY
ssss tries to lock its virtual address space into RAM for privacy reasons. But this may fail for two reasons: either the current uid doesn't permit page locking, or the RLIMIT_MEMLOCK is set too low. After printing a warning message ssss will run even without obtaining the desired mlock. AUTHOR
This software (v0.5) was written in 2006 by B. Poettering (ssss AT point-at-infinity.org). Find the newest version of ssss on the project's homepage: http://point-at-infinity.org/ssss/. FURTHER READING
http://en.wikipedia.org/wiki/Secret_sharing Manuals User ssss(1)
All times are GMT -4. The time now is 07:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy