I don't think they're quirky. bash expands the here string's variable into a temp text file and redirects stdin (FD 0 below) thereto:
Any text file is terminated by a <NL> char, which is read into your "a" variable as well and treated/printed out (maybe converted to a NULL char by the shell)
The read built-in always strips the trailing <newline> character from lines it reads.
If read didn't work this way, the common sequence:
(a dangerous way to implement cat file as a shell script) would double-space all of its output.
Similarly command substitution (both `commnd` and $(command)) strips trailing <newline> characters if one or more are present. Try, for example:
which produces the output:
HI,
I want to cut end string from line.
e.g. i have following input line
/users/home/test.txt
I want to get end string 'test.txt' from above line and length of that end string will change and it always start after '/'.
Thanks,
Visu (7 Replies)
I have a comma delimited text file and need to appened ",000000" to the end of every line. For example:
Before:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll $" ,1103.45
After:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll... (3 Replies)
Hi, guys. I have one question:
I have a file called "group", the contents of it is below:
********************************
...
test:x:203:
sales:x:204:
repair:x:205:
research:x:206:brownj
...
***********
Now I want to add string ",sherrys" at the end of "research:x:206:brownj", so... (5 Replies)
Hello
How can I add a string (always the same) at the end of a specific line in a file...
The file is:
000000001 041 L $$aspa
000000001 088 L $$aJ.E.N. 551
000000001 090 L $$aINFORMES JEN
000000001 100 L $$aautor 1
----
000000002 041 L $$aeng
000000002 088 L $$aJ.E.N. 1... (13 Replies)
I've a problem to put .h end of the line..below my input file
fg_a
bb
fg_b
bb
fg_c
bb
fg_d
aa
fg_f
ee
and i want the output file as below
fg_a.h
bb
fg_b.h
bb
fg_c.h
bb
fg_d.h (6 Replies)
Dear All
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB... (5 Replies)
Platform: Solaris 10
I have a file like below
$ cat languages.txt
Spanish
Norwegian
English
Persian
German
Portugese
Chinese
Korean
Hindi
Malayalam
Bengali
Italian
Greek
Arabic
I want to append the string " is a great language" at end of each line in this file. (3 Replies)
Hi
I have a very large data file with several hundred columns and millions of lines.
The important data is in the last set of columns with variable numbers of tab delimited fields in front of it on each line.
Im currently trying sed to get the data out - I want anything beetween :RES and... (4 Replies)
Hi,
I have a file which is an extract of jil codes of all autosys jobs in our server.
Sample jil code:
**************************
permission:gx,wx
date_conditions:yes
days_of_week:all
start_times:"05:00"
condition: notrunning(appDev#box#ProductLoad)... (1 Reply)
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
LEARN ABOUT HPUX
tsi
TSI(5) File Formats Manual TSI(5)NAME
tsi - Transmission Subscriber Identification (TSI) access control list
DESCRIPTION
The HylaFAX configuration parameter QualifyTSI specifies whether or not the identity of a calling facsimile machine should be checked
against an access control list before receiving facsimile. If QualifyTSI is non-null, then only messages from facsimile machines identi-
fied in the file specified by the string (typically etc/tsi) will be accepted.
Patterns are specified one per line and must conform to the regular expressions syntax specified by POSIX 1003.2; see re_format(7). Com-
ments may be included; they are introduced with the ``#'' character and extend to the end of the line. Any trailing white space on a line
is ignored (for convenience when comments are used).
If a line begins with ``!'', then the regular expression identifies clients that should be rejected; otherwise regular expressions identify
clients whose transmissions should be accepted. The order of patterns in a TSI file is important. When a facsimile is to be received, the
fax server will compare the client's TSI against the patterns in the access control list in the order in which they appear in the file.
The first pattern that matches the client TSI is used to decide whether to accept or reject the facsimile. If no patterns match the client
TSI then the facsimile is rejected. Thus if you want to accept all but a restricted set of TSI the last line in the file should be
``^.*$''.
Note that regular expression patterns should be written to match a TSI exactly. That is, patterns should be of the form:
^<pattern>$
where the ``^'' and ``$'' characters are used to specify the start and end of the matching TSI. Additionally, regular expression patterns
should handle white space that may appear in known locations. For example,
^([+]1){1}[ .-]*415[ .-]*555[ .-]*1212.*$
matches the following TSI strings:
+1.415.555.1212
415 555 1212
1-415-555-1212
Finally, note that regular expressions can be used to specify many TSI with one pattern.
NOTES
It would be nice if TSI that were to be matched against were placed in some canonical form (e.g. remove white space and white space-like
characters). This is, however, problematic, because some facsimile machines permit any printable ASCII string to be sent as a TSI.
SEE ALSO faxgetty(8), re_format(7), hylafax-config(5)
December 5, 1994 TSI(5)