Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Trying to understand a complex bit of code Post 302754521 by Corona688 on Thursday 10th of January 2013 04:34:19 PM
Old 01-10-2013
Quote:
Originally Posted by Marc G
OK,

I still don't get why the "[[]]" rather than the "[]"
[[ ]] is an extended version of [ ]. Some shells don't have it.

I'd start by looking at what strings get input to it, and what strings come out of each half.
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Code Understand ?

Hey, Could you explain me what this code is doing ? For example: $i has value 9 $1 is the name of the file say FILEBkUp while do if $1.`/bin/expr $i - 1` ] then mv -f $1.`/bin/expr $i - 1` $1.$i fi i=`/bin/expr $i - 1` done Thanks... (2 Replies)
Discussion started by: varungupta
2 Replies

2. Solaris

Porting C++ 32-bit code on 64-bit Solaris

Hi, I am trying to convert 32-bit code to 64-bit. I have defined function int main() { int* l; size_t len1; fun(len1); return 0; } void fun(int* ptr) { cout<<"\nsizeof(ptr)"<<sizeof(ptr); } However while compiling getting error as : Error: Formal argument ptr... (2 Replies)
Discussion started by: amit_27
2 Replies

3. UNIX for Dummies Questions & Answers

unable to understand a awk code

i am not able to understand the following code for awk: $awk -F"|" '{ kount++} >END { for (desig in kount) > print desig,kount }' emp.list the input file i.e. emp.list is :: 3432| p.k.agrwal |g.m |sales 4566|g.l.sharma |director|production 3433|r shah | g.m | production... (1 Reply)
Discussion started by: streetfi8er
1 Replies

4. Shell Programming and Scripting

search 3 file and write to 4th file (a bit complex)

hi buddies; rollbackip.txt:10.14.3.65 2 10.14.3.65 3 ... lookup.txt: ... 10.14.3.65 2 10.14.5.55 1 55 10.14.6.66 1 66 10.14.3.65 3 10.14.7.77 3 77 10.14.8.88 2 88 10.14.9.99 4 99 ... ip-port.txt ... port111 3 10.14.5.55 57 port111 2 10.14.5.55 51 port111 1 10.14.5.55 59 ->... (7 Replies)
Discussion started by: gc_sw
7 Replies

5. Shell Programming and Scripting

Need help to understand Awk code.

Hi Guys, Can someone please explain this code to me. I could figure out it's adding and comparing two fields but I am not sure which ones. sort -t"|" -k3.1 /tmp/mpcashqc.xtr| awk -F"|" '{CHECKAMT+=$3;BATCHTOT=$4;\ items++}END{for(i in CHECKAMT) if (CHECKAMT!=BATCHTOT)... (6 Replies)
Discussion started by: nua7
6 Replies

6. Programming

Need help with this c++ source code! DOnt understand what some stuff mean.

Okay so I am just starting programming c++. I just started started to red "C++ for Dummies yesterday and theres a lot of things I do not understand from this book and this source code especially. I will first post the full source code and then post questions about certain thing, usually what they... (2 Replies)
Discussion started by: orszhak
2 Replies

7. Shell Programming and Scripting

help can't understand the code

Hi All, Good day, i'm just wondering what is the meaning of this code? COUNT_EXTRACTED_FILE=`${ECHO_CMD} "${SE_IN_PATH}${SE_IN_FILE}" | ${AWK_CMD} -F"__" '{print $2}'` Thanks, -niks(newbie) (2 Replies)
Discussion started by: nikki1200
2 Replies

8. UNIX for Dummies Questions & Answers

help me to understand this code

Hi guys can you please help me to understand this code . tmpArray=(${line//=/ }) Please next time open a new thread in the appropriate forum and use code tags (6 Replies)
Discussion started by: sandhya.gilla
6 Replies
TPM QUOTE 
TOOLS(8) TPM QUOTE TOOLS(8) NAME
TPM Quote Tools PROGRAMS
tpm_mkuuid, tpm_mkaik, tpm_loadkey, tpm_unloadkey, tpm_getpcrhash, tpm_updatepcrhash, tpm_getquote, tpm_verifyquote DESCRIPTION
TPM Quote Tools is a collection of programs that provide support for TPM based attestation using the TPM quote operation. A TPM contains a set of Platform Configuration Registers (PCRs). In a well configured machine, some of these registers are set to known values during the boot up process or at other times. For example, a PCR might contain the hash of a boot loader in memory before it is run. The TPM quote operation is used to authoritatively verify the contents of a TPM's Platform Configuration Registers (PCRs). During provi- sioning, a composite hash of a selected set of PCRs is computed. The TPM quote operation produces a composite hash that can be compared with the one computed while provisioning. To use the TPM quote operation, keys must be generated. During provisioning, an Attestation Identity Key (AIK) is generated for each TPM, and the public part of the key is made available to entities that validate quotes. The TPM quote operation returns signed data and a signature. The data that is signed contains the PCRs selected for the operation, the composite hash for the selected PCRs, and a nonce provided as input, and used to prevent replay attacks. At provisioning time, the data that is signed is stored, not just the composite hash. The signature is discarded. An entity that wishes to evaluate a machine generates a nonce, and sends it along with the set of PCR used to generate the composite PCR hash at provisioning time. For this use of the TPM quote operation, the signed data is ignored, and the signature returned is used to val- idate the state of the TPM's PCRs. Given the signature, the evaluating entity replaces the nonce in the signed data generated at provi- sioning time, and checks to see if the signature is valid for the data. If so, this check ensures the selected PCRs contain values that match the ones measured during provisioning. A typical scenario for an enterprise using these tools follows. The tools expect AIKs to be referenced via one enterprise-wide Universally Unique Identifier (UUID). The program tpm_mkuuid creates one. For each machine being checked, an AIK is created using tpm_mkaik. The key blob produced is bound to the UUID on its machine using tpm_loadkey. The public key associated with the AIK is sent to the entities that verify quotes. Finally, the expected PCR composite hash is obtained using tpm_getpcrhash. When the expected PCR values change, a new hash can be generated with tpm_updatepcrhash. The program to obtain a quote, and thus measure the current state of the PCRs is tpm_getquote. The program that verifies the quote describes the same PCR composite hash as was measured initially is tpm_verifyquote. SEE ALSO
tpm_mkuuid(8), tpm_mkaik(8), tpm_loadkey(8), tpm_unloadkey(8), tpm_getpcrhash(8), tpm_updatepcrhash(8), tpm_getquote(8), tpm_verifyquote(8) Oct 2010 TPM QUOTE TOOLS(8)
All times are GMT -4. The time now is 07:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy