02-15-2010
Variable of Content From Part of Other File
I may not being doing this description justice, but I'll give it a try.
I created a mailx script; there will be several messages using the same script where the only difference is the content. So I figured I'd make the content of the message a variable retrieved from a separate file. I have five (5) types of message content, could I put all five in one text file and retrieve the specified message content in my message script; so that all five can reside on the same file versus on five separate files where I'd do a `cat filename.txt`?
If I didn't explain it well, please let me know.
v/r
Roy
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello!
I'm having problems trying to extract the contents of a variable and placing it into a text file. Grateful for any help.
Been trying something along the lines of:
$variable > file.txt
or
`cat < $variable` > file.txt
As you can see I'm a newbie to this :D (2 Replies)
Discussion started by: lloowen
2 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
I have a problem here. I have a file and let we take the content of the file is just '32' (only a numeric value in that file). Now I need to assign this numeric value ( value in that file) to a variable. Is that possible? If so, can you plz advice me on this?
Thanks in... (4 Replies)
Discussion started by: iamgeethuj
4 Replies
3. Shell Programming and Scripting
For example, I have a simple text file
note:
this a note
a simple note
a very very simple notewhen I use this command,
temp=$(cat "note.txt")then I echo temp, the result is in one line.
echo $temp
note: this a note a simple note a very very simple noteMy variable doesn't have newline.
How... (7 Replies)
Discussion started by: 14th
7 Replies
4. Shell Programming and Scripting
Hello,
I have following problem.
I have the result of a database request. I preparated the result via sed, etc. as a string in a file.
The string in the file is:
($3==1 || $3==2 || $3==3 || $3==4)
Now I want to use the String as a command in an if-statement.
So I assigned the string to a... (3 Replies)
Discussion started by: Dr_Aleman
3 Replies
5. Shell Programming and Scripting
Hi,
I am working on one script..I am having files in the below format
file 1 (each line is separated with : delimeter)
SPLASH:SPLASH:SVN
CIB/MCH:MCH:SVN
Now I want from file 1 that most left part of the first line will store in... (6 Replies)
Discussion started by: rohit22hamirpur
6 Replies
6. Programming
All,
I have a log file containing lots of data now i want to extract all text between block below(names) without the title or end pattern but only names,
++++START++++
SCOTT TIGER
HENRY PAUL
JARED OTIENO
OMOLLO JA NIGERIA
++++END++++
the names i want to return and store in a variable in... (1 Reply)
Discussion started by: Scott2000
1 Replies
7. Shell Programming and Scripting
I have a file File1 containing lines like below
apple ${FRUIT}-Color
orange ${FRUIT}-Color
banana ${FRUIT}-Color
Now, in my shell I'm reading the file like below
while read FRUIT DESC; do echo $FRUIT $DESC; done < File1
which outputs -
apple ${FRUIT}-Color
orange ${FRUIT}-Color... (3 Replies)
Discussion started by: nexional
3 Replies
8. UNIX for Dummies Questions & Answers
hi i just cant figure out how can i do this ls -lt > log.txt using $PWD
what i mean is how can i get the ls command content into a file using $PWD variable? :confused: (4 Replies)
Discussion started by: chinababy
4 Replies
9. Shell Programming and Scripting
I have a variable and assigned the following values
***XYZ_201519_20150929140642_20150929140644_211_0_0_211
I need to read this variable from backward and stop read when I get first underscore (_)
In this scenario I should get 211
Thanks
Kris (3 Replies)
Discussion started by: mkris
3 Replies
10. Shell Programming and Scripting
Dear all,
I have a "SQL request" in a file: that request include different "host variable" and I would like to substitute the different "host variable" by their respective content before executing the request.
For example:
$ echo $SHELL
/bin/bash
$ cat dae2.txt
DELETE FROM ... (11 Replies)
Discussion started by: dae
11 Replies
MHLIST(1) [nmh-1.5] MHLIST(1)
NAME
mhlist - list information about MIME messages
SYNOPSIS
mhlist [+folder] [msgs] [-file file] [-part number] ... [-type content] ... [-headers | -noheaders] [-realsize | -norealsize] [-rcache
policy] [-wcache policy] [-check | -nocheck] [-verbose | -noverbose] [-version] [-help]
DESCRIPTION
The mhlist command allows you to list information (essentially a table of contents) about the various parts of a collection of MIME (multi-
media) messages.
mhlist manipulates MIME (multi-media messages) as specified in RFC-2045 thru RFC-2049 (See mhbuild(1)).
The -headers switch indicates that a one-line banner should be displayed above the listing.
The -realsize switch tells mhlist to evaluate the "native" (decoded) format of each content prior to listing. This provides an accurate
count at the expense of a small delay.
If the -verbose switch is present, then the listing will show any "extra" information that is present in the message, such as comments in
the "Content-Type" header.
The option -file file directs mhlist to use the specified file as the source message, rather than a message from a folder. If you specify
this file as "-", then mhlist will accept the source message on the standard input. Note that the file, or input from standard input
should be a validly formatted message, just like any other nmh message. It should NOT be in mail drop format (to convert a file in mail
drop format to a folder of nmh messages, see inc(1)).
By default, mhlist will list information about the entire message (all of its parts). By using the -part and -type switches, you may limit
the scope of this command to particular subparts (of a multipart content) and/or particular content types.
A part specification consists of a series of numbers separated by dots. For example, in a multipart content containing three parts, these
would be named as 1, 2, and 3, respectively. If part 2 was also a multipart content containing two parts, these would be named as 2.1 and
2.2, respectively. Note that the -part switch is effective for only messages containing a multipart content. If a message has some other
kind of content, or if the part is itself another multipart content, the -part switch will not prevent the content from being acted upon.
A content specification consists of a content type and a subtype. The initial list of "standard" content types and subtypes can be found
in RFC-2046.
A list of commonly used contents is briefly reproduced here:
Type Subtypes
---- --------
text plain, enriched
multipart mixed, alternative, digest, parallel
message rfc822, partial, external-body
application octet-stream, postscript
image jpeg, gif, png
audio basic
video mpeg
A legal MIME message must contain a subtype specification.
To specify a content, regardless of its subtype, just use the name of the content, e.g., "audio". To specify a specific subtype, separate
the two with a slash, e.g., "audio/basic". Note that regardless of the values given to the -type switch, a multipart content (of any sub-
type listed above) is always acted upon. Further note that if the -type switch is used, and it is desirable to act on a message/external-
body content, then the -type switch must be used twice: once for message/external-body and once for the content externally referenced.
Checking the Contents
The -check switch tells mhlist to check each content for an integrity checksum. If a content has such a checksum (specified as a Content-
MD5 header field), then mhlist will attempt to verify the integrity of the content.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
SEE ALSO
mhbuild(1), mhshow(1), mhstore(1), sendfiles(1)
DEFAULTS
`+folder' defaults to the current folder
`msgs' defaults to cur
`-nocheck'
`-headers'
`-realsize'
`-rcache ask'
`-wcache ask'
`-noverbose'
CONTEXT
If a folder is given, it will become the current folder. The last message selected will become the current message.
MH.6.8 11 June 2012 MHLIST(1)