Can some body tell me how to print number of line from a particular file, with sed. ?
Input file format
AAAA
BBBB
CCCC
SDFFF
DDDD
DDDD
Command to print line 2 and 3 ?
BBBB
CCCC
And also please tell me how to assign column sum to variable.
I user the following command it... (1 Reply)
Hi!
How can I print out a specific range of rows, like "cat file | awk NR==5,NR==9", but in the END-statement?
I have a small awk-script that finds specific rows in a file and saves the line number in an array, like this:
awk '
BEGIN { count=0}
/ZZZZ/ {
list=NR
... (10 Replies)
Hi,
I want to print only lines in between two strings and not the strings using awk.
Eg:
OUTPUT
top 2
bottom 1
left 0
right 0
page 66
END
I want to print into a new file only
top 2
bottom 1
left 0... (4 Replies)
Hi everyone!
I'm not new to Unix, but I've never used awk before.
I tried to look up this information on several sites and forums,
I also looked in the documentation but I haven't found a solution yet.
I would like to print the previous 3 lines before and the following 4 lines after the... (6 Replies)
Ok so I can use awk to match a pattern and print the whole line with print $0. Is there any way to just tell awk to print every line of output when the pattern matches?
I'm having it wait for the word error and then print that entire line. But what I actually need to see is all the following... (9 Replies)
I need to print a specific string from an html file that's always occurring between two other known strings. Example: from the text below, I would like to print the bolded part:
<this is a lot of text before the string I want
to print> fullpath: abc/def/ghi/example.xlf -cfver. <sample text... (15 Replies)
URGENT HELP IS NEEDED!!
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
- Also the matching lines are not moving out of File1.txt
... (1 Reply)
Hello to all,
I'm trying to print the value corresponding to the words A, B, C, D, E. These words could appear sometimes and sometimes not inside each group of lines. Each group of lines begins with "ZYX".
My issue with current code is that should print values for 3 groups and only is... (6 Replies)
Hi again,
is it possible to do the following using awk?
input file is
4.465E+17
5.423E+16
1.218E+17
2.600E+16
9.135E+15
1.238E+14
...
6.238E+14
desired output
4.465E+17 &
5.423E+16 &
1.218E+17 &
2.600E+16 &
9.135E+15 &
1.238E+14 &
... & (3 Replies)
Discussion started by: f_o_555
3 Replies
LEARN ABOUT ULTRIX
machine-info
MACHINE-INFO(5) machine-info MACHINE-INFO(5)NAME
machine-info - Local machine information file
SYNOPSIS
/etc/machine-info
DESCRIPTION
The /etc/machine-info file contains machine metadata.
The basic file format of machine-info is a newline-separated list of environment-like shell-compatible variable assignments. It is possible
to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported, allowing
applications to read the file without implementing a shell compatible execution engine.
/etc/machine-info contains metadata about the machine that is set by the user or administrator.
Depending on the operating system other configuration files might be checked for machine information as well, however only as fallback.
You may use hostnamectl(1) to change the settings of this file from the command line.
OPTIONS
The following machine metadata parameters may be set using /etc/machine-info:
PRETTY_HOSTNAME=
A pretty human-readable UTF-8 machine identifier string. This should contain a name like "Lennart's Laptop" which is useful to present
to the user and does not suffer by the syntax limitations of internet domain names. If possible, the internet hostname as configured in
/etc/hostname should be kept similar to this one. Example: if this value is "Lennart's Computer" an Internet hostname of
"lennarts-computer" might be a good choice. If this parameter is not set, an application should fall back to the Internet host name for
presentation purposes.
ICON_NAME=
An icon identifying this machine according to the XDG Icon Naming Specification[1]. If this parameter is not set, an application should
fall back to "computer" or a similar icon name.
CHASSIS=
The chassis type. Currently, the following chassis types are defined: "desktop", "laptop", "convertible", "server", "tablet",
"handset", "watch", and "embedded", as well as the special chassis types "vm" and "container" for virtualized systems that lack an
immediate physical chassis. Note that many systems allow detection of the chassis type automatically (based on firmware information or
suchlike). This setting (if set) shall take precedence over automatically detected information and is useful to override misdetected
configuration or to manually configure the chassis type where automatic detection is not available.
DEPLOYMENT=
Describes the system deployment environment. One of the following is suggested: "development", "integration", "staging", "production".
LOCATION=
Describes the system location if applicable and known. Takes a human-friendly, free-form string. This may be as generic as "Berlin,
Germany" or as specific as "Left Rack, 2nd Shelf".
EXAMPLE
PRETTY_HOSTNAME="Lennart's Tablet"
ICON_NAME=computer-tablet
CHASSIS=tablet
DEPLOYMENT=production
SEE ALSO systemd(1), os-release(5), hostname(5), machine-id(5), hostnamectl(1), systemd-hostnamed.service(8)NOTES
1. XDG Icon Naming Specification
http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
systemd 237 MACHINE-INFO(5)