09-14-2007
Basically, in the awk script, all the work is done by the printf function. Awk is needed only to split the string in three separate variables, using the colon as delimiter.
I suggest you a "man printf" and "man formats", because this function is very powerful and can accept a large amount of string format specification. In our case, we need to print left padded numbers with zeroes, two characters as total length. You achieve this with the format string "%02d", where "d" represents an integer, "0" is the padding character and 2 is the length.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
Q1: are the variables in shell script usually UPPER CASE?
Q2: can sed output to the same file that it's using it?
eg. cat sameFile | sed 's/here/there/g' > sameFile ?
I expect the sed replace all "here" to "there" and change it in sameFile.
i tried that one, the sameFile... (1 Reply)
Discussion started by: gusla
1 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have a file where I am supposed to convert all the single i characters to uppercase, but when I try, it converts all the i's inside of words to uppercase as well.
I tried doing:
cat filename | sed 's/i/I/g'
but that obviously does not work.
Any help would be greatly... (6 Replies)
Discussion started by: zlindner
6 Replies
3. UNIX for Dummies Questions & Answers
The file dbnames.txt has 5 columns, what i'm trying to do is that when the fifth column equals A, store in the variable "access" the word, "admin access". If it equals B, then "business access" etc. I think their is a problem with my sed command, because it is not substibstituting the words... (1 Reply)
Discussion started by: ross_one
1 Replies
4. Shell Programming and Scripting
I need to remove a pattern say, ABCD whether it is in uppercase or lowercase from a string. How to do it using SED?
for example
ABCDEF should output to EF
abcdEF should also output to EF (2 Replies)
Discussion started by: vickylife
2 Replies
5. Shell Programming and Scripting
I am getting a parameter from a user and I need to use it to search and return the matching line numbers in a file. I am using this code:
recordNumber="$(sed -n '/'"$entry"'/{
=
d
}' unixdb1.txt)"
where $entry is the passed search parameter. The problem is I need to ignore the case. ... (3 Replies)
Discussion started by: snag49ers
3 Replies
6. Shell Programming and Scripting
Hi
I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute":
original becomes substitute
Origninal becomes Substitute
ORIGINAL becomes SUBSTITUTE
I know this a little special but it's not... (1 Reply)
Discussion started by: kmchen
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a file named "test_file" that has the below content. It has words in upper/lower cases
PRODOPS
prodOPS
ProdOps
PRODops
escalate
Shell
My requirement is to replace all the "prodops" (what ever case it may be) with "productionoperations".
I tried using the "i" option with... (7 Replies)
Discussion started by: sbhuvana20
7 Replies
8. Shell Programming and Scripting
i have something like this in a file
cat onlytables.sql
create table NextID (
id int auto_increment,
zoneID int,
entityName varchar(64),
nextID int,
lastModified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
primary... (6 Replies)
Discussion started by: vivek d r
6 Replies
9. Shell Programming and Scripting
Experts,
Good day!,
I have following data, I want to filter 3rd Field, if it is in UPPERCASE,
aa aa1 HOST1
aa bb1 host2
aa cc1 SERV1
aa dd1 SERV2
ab aa1 host3
The output should be:
aa aa1 HOST1
aa cc1 SERV1
aa dd1 SERV2 (2 Replies)
Discussion started by: rveri
2 Replies
10. UNIX for Beginners Questions & Answers
Dears,
In the below string, please let me know how to make the sed search case-incensitive. I have more such lines in my script instead of let me know any other easier option.
sed -n '/dn: MSISDN=/,/^\s*$/p' full.ldif > temp ; sed -n... (4 Replies)
Discussion started by: Kamesh G
4 Replies
LEARN ABOUT DEBIAN
tpm_changeownerauth
tpm_changeownerauth(8) System Manager's Manual tpm_changeownerauth(8)
TPM Management - tpm_changeownerauth
NAME
tpm_changeownerauth - change the authorization data associated with the owner or SRK
SYNOPSIS
tpm_changeownerauth [OPTION]
DESCRIPTION
tpm_changeownerauth allows for changing the authorization data for the TPM owner or the TPM's Storage Root Key (via the TPM_ChangeAuthOwner
API). This operation prompts for current password, followed by the new password and a confirmation of the new password. The --owner option
changes the TPM owner password and --srk option changes the TPM's SRK password. The --well-known option is used when SRK or owner passwords
need to be changed and current owner password is a secret of zeros, --set-well-known option changes current password to a secret of zeros,
both options do not work by themselves, they must be used with --owner and --srk options to indicate which of these passwords will be
changed.
-h, --help
Display command usage info.
-v, --version
Display command version info.
-l, --log [none|error|info|debug]
Set logging level.
-u, --unicode
Use TSS UNICODE encoding for passwords to comply with applications using TSS popup boxes
-o, --owner
Change the authorization data for the TPM owner.
-s, --srk
Change the authorization data for the TPM's Storage Root Key.
-g, --original_password_unicode
Use TSS UNICODE encoding for original password to comply with applications using TSS popup boxes
-n, --new_password_unicode
Use TSS UNICODE encoding for new password to comply with applications using TSS popup boxes
-z, --well-known
Change password to a new one when current owner password is a secret of all zeros (20 bytes of zeros). It must be specified which
password (owner, SRK or both) to change
-r, --set-well-known
Change password to a secret of all zeros (20 bytes of zeros). It must be specified which password (owner, SRK or both) to change
SEE ALSO
tpm_version(1), tpm_takeownership(8), tcsd(8)
REPORTING BUGS
Report bugs to <trousers-users@lists.sourceforge.net>
TPM Management 2005-05-06 tpm_changeownerauth(8)