Sponsored Content
Top Forums Shell Programming and Scripting Read Embedded Newline characters with read (builtin) in KSH93 Post 302486906 by DGPickett on Monday 10th of January 2011 05:03:32 PM
Old 01-10-2011
Asking a line oriented tool to not be line oriented is tough, but if you know it is continued, say because of an escape character, why not read again and concatenate?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace characters then read the file without changing it

Hi All At the moment the following code works but ideally i do not want to have to change the original $1 tr "\r" "\n" < "$1" > "$1.fix" printf "\n" >> "$1.fix" mv "$1.fix" "$1" FILE=$1 coffee_out="splitmovie" coffee_fill="-splitAt" coffee_end="-self-contained -o output.mov $2"... (1 Reply)
Discussion started by: babajuma
1 Replies

2. Shell Programming and Scripting

Removing Embedded Newline from Delimited File

Hey there - a bit of background on what I'm trying to accomplish, first off. I am trying to load the data from a pipe delimited file into a database. The loading tool that I use cannot handle embedded newline characters within a field, so I need to scrub them out. Solutions that I have tried... (7 Replies)
Discussion started by: bbetteridge
7 Replies

3. Shell Programming and Scripting

Read text from a file between two characters..

I have a requirement where i have to read from a .sh file a text lying bet characters like 'SELECT' & ';'...Please help me out in this. I am new to shell scripting. (2 Replies)
Discussion started by: goutam_igate
2 Replies

4. UNIX for Dummies Questions & Answers

ksh93 newline character problem

Hi , I am working on Linux, with ksh93 installed. The following statement echo \\n just prints \n on this shell. However on pdksh echo \\n gives a blank new line as a output. What is the correct way of printing a new line character on the ksh93? (4 Replies)
Discussion started by: neeto
4 Replies

5. Programming

How to make gl_get_line read unicode characters

Hi, My program uses gl_get_line from libtecla to get user input from terminal. It works fine as long as I enter English at the terminal prompt. However, if I enter other languages, such as Chinese characters, either by typing in or cut-and-paste, the input characters get cleared from terminal... (5 Replies)
Discussion started by: tdw
5 Replies

6. Shell Programming and Scripting

how to read multi line characters in a single column

Hi, I have file in which fields are pipe (|) separated and the record separator is new line (\n). But sometime I am getting a field value which is spread across multiple line. Basically I am getting a file from another system in the below format and needs to process the file and load data into a... (3 Replies)
Discussion started by: satyaatcgi
3 Replies

7. Windows & DOS: Issues & Discussions

Read last 7 characters from line ?

I have a txt like this: 638.301 (0.00973985) @ 50+55 the thing I want to do is read the last seven characters from the end of the first line. how do I do this ? Thanks in advance and sorry for being DOS only here. (2 Replies)
Discussion started by: pasc
2 Replies

8. UNIX for Dummies Questions & Answers

Characters in a single read

Hi, I have the file which has the data : accctaaccctaaccctaaccctaaccctaaccctaaccctaaccctaac cctaacccaaccctaaccctaaccctaaccctaaccctaaccctaacccc taaccctaaccctaaccctaaccctaacctaaccctaaccctaaccctaa ccctaaccctaaccctaaccctaaccctaacccctaaccctaaccctaaa... (24 Replies)
Discussion started by: rajivn786
24 Replies

9. Programming

How to read extended ASCII characters from stdin?

Hi, I want to read extended ASCII characters from keyboard using c language on unix/linux. How to read extended characters from keyboard or by copy-paste in terminal irrespective of locale set in the system. I want to read the input characters from keyboard, store it in an array or some local... (3 Replies)
Discussion started by: sanzee007
3 Replies

10. Programming

Read in numbers from console won't stop at newline.

Hello, I have snippet code from Lippman's <<C++ primer>>. The program is to convert regular decimal (0 ~ 15) numbers to basic hexdecimals. The instruction tells the program will execute by hitting newline at the end. When I tried to run the compiled program, hitting ENTER did not work as... (3 Replies)
Discussion started by: yifangt
3 Replies
builtin(1)							   User Commands							builtin(1)

NAME
builtin - ksh93 built-in function to add, delete, or display shell built-ins SYNOPSIS
builtin [-ds] [-f lib] [pathname ...] DESCRIPTION
The ksh93 builtin command adds, deletes, or displays built-in commands in the current shell environment. A built-in command executes in the current shell process and can have side effects in the current shell. On most systems, the invocation time for built-in commands is one or two orders of magnitude less than commands that create a separate process. For each pathname specified, the basename of the pathname determines the name of the built-in. For each basename, the shell looks for a C level function in the current shell whose name is determined by pre-pending b_ to the built-in name. If pathname contains a forward slash (/), the built-in is bound to pathname. A built-in bound to a pathname is only executed if pathname is the first executable found during a path search. Otherwise, built-ins are found prior to performing the path search. If pathname is not specified, builtin displays the current list of built-ins, or just the special built-ins if the -s option is specified, on standard output. The full pathname for built-ins that are bound to pathnames are displayed. Libraries containing built-ins can be specified with the -f option. If the library contains a function named lib_init(), this function is invoked with argument 0 when the library is loaded. The lib_init() function can load built-ins by invoking an appropriate C level function. In this case there is no restriction on the C level function name. The C level function is invoked with three arguments. The first two are the same as main() and the third one is a pointer. The ksh93 builtin command cannot be invoked from a restricted shell. OPTIONS
The following options are supported: -d Delete each of the specified built-ins. Special built-ins cannot be deleted. -f lib On systems with dynamic linking, load and search for built-ins in the shared library, lib. Libraries are searched for in $PATH and system dependent library directories. The system dependent shared library prefix or suf- fix can be omitted. Once a library is loaded, its symbols become available for the current and subsequent invocations of builtin. Multiple libraries can be specified with separate invocations of builtin. Libraries are searched in the reverse order in which they are specified. -s Display only the special built-ins. OPERANDS
The following operands are supported: pathname Specifies the pathname. The basename of the pathname determines the name of the built-in. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. EXAMPLES
Example 1 Loading a builtin Command The following example loads a builtin command mycmd from the library libfoo.so: example% builtin -f foo mycmd AUTHORS
David Korn, dgk@research.att.com ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Uncommitted | +-----------------------------+-----------------------------+ SEE ALSO
ksh93(1), whence(1), attributes(5) SunOS 5.11 1 May 2007 builtin(1)
All times are GMT -4. The time now is 03:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy