Hi,
If I want to have a look at few lines of the file, how do I, what command to use.
Eg: If I have a file having length 2000 lines and I want to have a look at the content between 1400 and 1600, How do I look at it ?
Also, If I want to have a look at function alone in a file, how do I go... (4 Replies)
Hi
to all in this great forum, im sure this has been asked lots of times before but ive been looking for the past day and cant find the answer.
I use cat/some/file to display its contents but how can i get it to not display hashed out lines, or do i need another command,
Thanks in advance:) (5 Replies)
I have an input file which looks like this:
601 a
602 a
603 a
601 b
610 c
615 c
603 d
601 d
612 d
I need the utput to look like this
601 a 602 603
602 a 601 603
603 a 601 602
601 b
610 c 615
615 c 610
603 d 601 612 (1 Reply)
Following are the lines from /etc/sudoers.conf
bob SPARC = (OP) ALL : SGI = (OP) ALL
fred ALL = (DB) NOPASSWD: ALL
ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\
/sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM
Could you please help me with shell/perl script to display the records
with... (2 Replies)
Hi,
I have written a perl script to dispaly some statements from a file but i want the output statements to be dispalyed in an HTML format.Is it possible for me to do in perl scripting?
Please help me with ur thoughts.
Thanks In Advance
Meva. (1 Reply)
Hello All,
I have a file whose data looks something like this
I want to extract just the id, name and city fields in a csv format and sort them by id. Output should look like this.
1,psi,zzz
2,beta,pqr
3,theta,xyz
4,alpha,abc
5,gamma,jkl (12 Replies)
Hi Guys,
I want to echo last 5 lines of a file to a mail. My script getting continuously looped and not getting the output. can anyone help?
#!/bin/bash
read karthick;
tail -5 $karthick;
echo $karthick | mail -s "genius" someone@gmail.com
Thanks
NK (2 Replies)
Hi Gurus,
I have some weird issue. when using
ls -l
the result shows different time format:
-rw-r--r-- 1 abc gourp1 3032605576 Jun 14 2013 abc
-rw-rw-r-- 1 abc gourp1 1689948832 Aug 10 06:22 abc
one display 2013 which is year; another one displays 06:22 which is time.
... (4 Replies)
Hi All,
I'm trying to print calendar using shell script and i'm able to print it. But the format is not good.
Here is the script.
#!/bin/bash
echo $(date)
echo "Hello $USER"
echo Hostname $(hostname)
echo Working in $(pwd)
echo Here is this month calender
echo $(cal)
$ sh first.sh... (7 Replies)
Discussion started by: chandrakanth
7 Replies
LEARN ABOUT OSF1
fmt
fmt(1) General Commands Manual fmt(1)NAME
fmt - Formats mail messages prior to sending
SYNOPSIS
fmt [-width] file...
DESCRIPTION
The fmt command reads the input file or files, or standard input if no files are specified, and writes to standard output a version of the
input with lines of a length as close as possible to width columns. (Because fmt is internationalized software, the number of display col-
umns is not necessarily equivalent to the number of bytes.)
The fmt command both joins and splits lines to achieve the desired width, but words are never joined or split; spaces are always preserved,
and lines are split at spaces only. In effect, fmt ignores newline characters in the input and wraps words to make lines a close as possi-
ble to width columns, resulting in individual lines of varying length but a consistent (new) text width overall. Because blank lines are
always preserved, fmt does not merge paragraphs separated by blank lines.
If you specify more than one file, the files are concatenated as input to fmt. If you do not specify -width, the default line length is 72
columns. Spacing at the beginning of input lines is always preserved in the output.
The fmt command is generally used to format mail messages to improve their appearance before they are sent. It may also be useful, how-
ever, for other simple formatting tasks. For example, when you are using vi, you can use the command :%!fmt -60 to reformat your text so
that all lines are approximately 60 columns long.
NOTES
The fmt command is a fast, simple formatting program. Standard text editing programs are more appropriate than fmt for complex formatting
operations. Do not use the fmt command if the message contains embedded messages or preformatted information from other files. This com-
mand formats the heading information in embedded messages and may change the format of preformatted information.
EXAMPLES
file1 contains these lines:
Australia is an island-continent, home to many very interesting plants and animals.
To reformat this text to a narrower width, enter: fmt -30 file1
This results in the following, displayed on your screen: Australia is an island-continent, home to many very interesting plants and
animals.
To make file1 wider, enter: fmt -60 file1
This results in: Australia is an island-continent, home to many very interesting plants and animals. To format a message you have
created with the mailx editor, at the left margin enter: ~|fmt
After you enter the command, your message is formatted, in this case to the default line length of 72 columns, and the word continue
is displayed to indicate that you can enter more information or send your message.
SEE ALSO
Commands: mail(1), mailx(1), vi(1)fmt(1)