04-29-2008
Hi,
You'll get the same output using the awk. You can also get the output of first words in firstword.txt
your command.... | awk {' print $1'} | tee firstword.txt
For example, if you want to get only the first word in uptime. use
$ uptime | awk {' print $1'}
01:59:45
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear people, can you please enlighten:
I need to do a (most probably) very simple thing but couldn't figure how.
I have files with lots of lines starting with a fixed expression:
Query=. (the dot is a space)
followed by different combinations of characters including special ones such... (5 Replies)
Discussion started by: roussine
5 Replies
2. Shell Programming and Scripting
Hi Guys,
I need to search a string and print the rest of the lines...
input: 8 0 90 1 0 59 20 2488 96 30006dde372 S ? 0:00 /etc/opt/SUNWconn/atm/bin/atmsnmpd -n
output: 00 /etc/opt/SUNWconn/atm/bin/atmsnmpd -n
Actually i don even need the first "00".. any suggestions is appreciated..... (13 Replies)
Discussion started by: mac4rfree
13 Replies
3. Shell Programming and Scripting
Hi all,
Our application installation uses "sed" command to delete rest of line. It work perfect on Linux but fail on Solaris.
The OS versions are Solaris 9 and Linux Red Hat AS 3.
yourfile.txt
hello and world
cat and dog
hello world
in linux:
cat yourfile.txt | sed ‘s/\(\+\)... (3 Replies)
Discussion started by: javac2005
3 Replies
4. UNIX for Dummies Questions & Answers
Hiiii
I have a file which contains huge data as
a.dat:
PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA
event name: 010990D
time shift: 7.3000
half duration: 5.0000
latitude: 24.4200
longitude: 94.9500
depth: 129.6000
Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies
5. Shell Programming and Scripting
i need to find ' - ' in a line , if i found i need to rest of the line including '-'
example
libmm-2.0
libytytsunos-5.6
output
libmm
libytytsunos (7 Replies)
Discussion started by: girija
7 Replies
6. Shell Programming and Scripting
Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum:
infile:
64_1535: Delm. = 86 var, aaga
64_1535: Fran. = 57 ex. ccc
64_1639: Feb. = 26 (link). def
64_1817: mar. = 3/4. drz ... (7 Replies)
Discussion started by: sdf
7 Replies
7. UNIX for Dummies Questions & Answers
Hi friends,
I have a file where I should search for a string and get the rest of the line but without the delimiter using awk.
for example I have the series of string in a file:
input_string.txt
bbb
ccc
aaa
and the mapping file looks like this.
mapping.txt
aaa|12
bbb|23
ccc|43... (11 Replies)
Discussion started by: kokoro
11 Replies
8. Shell Programming and Scripting
Hi,
I have one requiremnet like this. I need to find some particular string (eg.IncludeDateTime = ) in a file. And wherever it finds the string the unix script has to delete the remaining text coming after the string (ie., 'IncludeDateTime = ' ) in the same line. I tried to write this script in... (5 Replies)
Discussion started by: jannusuresh
5 Replies
9. UNIX for Advanced & Expert Users
Hi ,
i have a file with data as below.This is same file. But actual file contains to many rows.
i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ?
Field 004... (7 Replies)
Discussion started by: vadlamudy
7 Replies
10. Programming
Could you tell me the possibilities of the reason to get the Mismatched free() / delete / delete .
I unable to see the line no in the valgrind report. it displays the function name. with that function name, I am not able to find where exactly the issue is there.I am getting the Mismatched free()... (3 Replies)
Discussion started by: SA_Palani
3 Replies
LEARN ABOUT CENTOS
tpm_nvdefine
tpm_nvdefine(8) tpm_nvdefine(8)
NAME
tpm_nvdefine
SYNOPSIS
tpm_nvdefine [OPTIONS]
DESCRIPTION
tpm_nvdefine defines a new NVRAM area at the given index and of given size. The user has to provide the permissions that control access to
the NVRAM area.
Owner authentication is necessary once the NVRAM area 0xFFFFFFFF has been defined. The owner password may be provided on the command line
using the owner password option.
The following options are supported:
-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
-y, --owner-well-known
Use a secret of all zeros (20 bytes of zeros) as the owner's secret.
-z, --area-well-known
Use a secret of all zeros (20 bytes of zeros) as the NVRAM area's secret.
-o, --pwdo (optional parameter)
The owner password.
A password may be directly provided for example by using '--pwdo=password' or '-opassword'. If no password is provided with this option
then the program will prompt the user for the password.
-a, --pwda (optional parameter)
The NVRAM area password.
A password may be directly provided for example by using '--pwda=password' or '-apassword'. If no password is provided with this option
then the program will prompt the user for the password.
-i, --index
The index of the NVRAM area. The parameter must either be a decimal number or a hexadecimal number starting with '0x'.
To select the NVRAM area with index 0x100, the command line parameter should be '-i 0x100' or '--index 0x100'.
-s, --size
The size of the NVRAM area. The parameter must either be a decimal number or a hexadecimal number starting with '0x'.
-p, --permissions
The access permissions associated with the NVRAM area. The parameter must either be a decimal number or a hexadecimal number staring
with '0x'. It is possible to logically 'or' numbers or strings. The following strings are supported:
AUTHREAD
Reading requires NVRAM area authorization.
AUTHWRITE
Writing requires NVRAM area authorization.
PPREAD
Reading requires physical presence.
PPWRITE
Writing requires physical presence.
OWNERREAD
Reading requires owner authorization.
OWNERWRITE
Writing requires owner authorization.
GLOBALLOCK
A write to index 0 locks the NVRAM area until the next TPM_Startup(ST_CLEAR)
READ_STCLEAR
A read with size 0 on the same index prevents further reading until the next TPM_Startup(ST_CLEAR)
WRITE_STCLEAR
A write with size 0 to the same index prevents further writing until the next TPM_Startup(ST_CLEAR)
WRITEDEFINE
A write with size 0 to the same index locks the NVRAM area permanently
WRITEALL
The value must be written in a single operation
An example of a permission parameter is:
--permissions="OWNERREAD|OWNERWRITE"
SEE ALSO
tpm_nvread(8), tpm_nvwrite(8), tpm_nvrelease(8), tpm_nvinfo(8)
REPORTING BUGS
Report bugs to <trousers-users@lists.sourceforge.net>
TPM Management 2011-07-07 tpm_nvdefine(8)