06-25-2013
I believe it has to do with ANSI escape sequences in the prompt, they will be taken as part of its length even though they don't contribute to string length, just string colors. This will make it miscalculate where it wraps the line.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
AIM: Need to test for the presence of some files (*.F) in a certain directory.
having a problem with this line is ksh:
if test `ls $SOMEDIR/dir/*.F \
2>/dev/null|wc -w` -eq 0
Basically testing for the presence of *.F files in the specified directory. If the return... (4 Replies)
Discussion started by: enoch
4 Replies
2. UNIX for Dummies Questions & Answers
HI, i need to remove about a 3000000 lines in a "too long file", without using vi editor. Im using hp-ux 11.0. (4 Replies)
Discussion started by: Goodfella
4 Replies
3. Shell Programming and Scripting
In a BASH library I'm creating, I have two functions that look like:
function check_process {
PIDFILE=$1
if ; then
PID=`cat $PIDFILE`
if && ; then
return 1
fi;
fi;
return 0
}
function fork_process {
CMD=$1
PIDFILE=$2
... (2 Replies)
Discussion started by: neked
2 Replies
4. UNIX for Dummies Questions & Answers
Hi Gurus,
I have a big file having around 5000 lines. What I need to do is as below.
$cat myfile
aaaa
bbbb
ccc
ddd
...
I want the output to be as below:
'aaaa,'bbbb','cccc'....
For this I have written something like this
code:
vi sac.txt |nawk '{printf NR","}'>ss
code: (2 Replies)
Discussion started by: thana
2 Replies
5. Shell Programming and Scripting
I'm using a barcode scanner to grab ISBNs. Unfortunately, short of hitting "enter" each time (not easy while on a ladder), there's no good way to split it up. So I scanned it into a series of long lines in notepad.
Now, I need to split each line into 12-number lines.
instead of:... (4 Replies)
Discussion started by: mbourgon
4 Replies
6. Shell Programming and Scripting
Greetings!
Some of my files list hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to display a message like "No error", else I display the error from the file itself.
I came up with this (with help)
for myfile in `find . -name... (2 Replies)
Discussion started by: alan
2 Replies
7. Shell Programming and Scripting
Does anyone know of any script or packages that allow the calculation of the geographical distance between two points of lat/long from within a bash shell?
I have been searching the web for the past few days and none of the options seem compatible with bash variables... (eg. geodist)
Many... (3 Replies)
Discussion started by: lily-anne
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I'm trying make a variable length file to a fixed length of 4000.
I'm to pad spaces on the right of a record if length is less than 4000 to make the record length 4000.
I'm trying to use the below commands
awk '{printf "%-4000s\n", $0}' inputfile.dat > outputfile.dat
sed -e :a... (12 Replies)
Discussion started by: uxusr
12 Replies
9. Shell Programming and Scripting
Greetings fellow scripters.
I find myself editing multiple files, sometimes with the same bits of information. My bash script, a changelog, and a plist file (OS X). Once I realized this, I thought why not script part of this process (and so it begins). In any case, I've solved several of the... (1 Reply)
Discussion started by: reid
1 Replies
10. Programming
I had been looking at page 75 of this online book:
http://richard.esplins.org/static/downloads/linux_book.pdf
I've used the system function in C to call bash commands before, but wanted to learn this way too. The solution in the book worked perfectly. However, I tried changing the simple "ls -l... (3 Replies)
Discussion started by: Azrael
3 Replies
LEARN ABOUT REDHAT
pswrap
PSWRAP(1) General Commands Manual PSWRAP(1)
NAME
pswrap - creates C procedures from segments of PostScript language code
SYNOPSIS
pswrap [ -apr ] [ -o outputCfile ] [ -h outputHfile ] [ -s maxstring ] inputfile
DESCRIPTION
pswrap reads input from inputfile and creates C-callable procedures, known as wraps, that send PostScript language code to the PostScript
interpreter. inputfile contains segments of PostScript language code wrapped with a C-like procedure syntax.
Wraps are the most efficient way for an application to communicate with the PostScript interpreter. For complete documentation of pswrap
and the language it accepts, see "pswrap Reference Manual" in Programming the Display PostScript System with X.
OPTIONS
inputfile
A file that contains one or more wrap definitions. pswrap transforms the definitions in inputfile into C procedures. If no input
file is specified, the standard input (which can be redirected from a file or pipe) is used. The input file can include text other
than wrap definitions. pswrap converts wrap definitions to C procedures and passes the other text through unchanged. Therefore, it
is possible to intersperse C-language source code with wrap definitions in the input file.
Note: Although C code is allowed in a pswrap input file, it is not allowed within a wrap body. In particular, no CPP macros (for
example, #define) are allowed inside a wrap.
-a Generates ANSI C procedure prototypes for procedure definitions in outputCfile and, optionally, outputHfile. The -a option allows
compilers that recognize the ANSI C standard to do more complete type checking of parameters. The -a option also causes pswrap to
generate const declarations.
Note: ANSI C procedure prototype syntax is not recognized by most non-ANSI C compilers, including many compilers based on the Porta-
ble C Compiler. Use the -a option only in conjunction with a compiler that conforms to the ANSI C Standard.
-h outputHFile
Generates a header file that contains extern declarations for non-static wraps. This file can be used in #include statements in mod-
ules that use wraps. If the -a option is specified, the declarations in the header file are ANSI C procedure prototypes. If the -h
option is omitted, a header file is not produced.
-o outputCFile
Specifies the file to which the generated wraps and passed-through text are written. If omitted, the standard output is used. If the
-a option is also specified, the procedure definitions generated by pswrap are in ANSI C procedure prototype syntax.
-p Specifies that strings passed by wraps are padded so that each data object begins on a long-word (4-byte) boundary. This option
allows wraps to run on architectures that restrict data alignment to 4-byte boundaries and improves performance on some other archi-
tectures.
-r Generates reentrant code for wraps shared by more than one process (as in shared libraries). Reentrant code can be called recur-
sively or by more than one thread. The -r option causes pswrap to generate extra code, so use it only when necessary.
-s maxstring
Sets the maximum allowable length of a PostScript string object or hexadecimal string object in the wrap body input. A syntax error
is reported if a string is not terminated with ) or > within maxstring characters. maxstring cannot be set lower than 80; the
default is 200.
SEE ALSO
Programming the Display PostScript System with X (Addison-Wesley Publishing Company, Inc., 1993).
AUTHOR
Adobe Systems Incorporated
NOTES
PostScript and Display PostScript are trademarks of Adobe Systems Incorporated which may be registered in certain jurisdictions.
Copyright (c) 1988-1994 Adobe Systems Incorporated. All rights reserved.
Adobe Systems 4 Apr 1994 PSWRAP(1)