Sponsored Content
Top Forums Shell Programming and Scripting ksh vs perl strange interaction. Post 302486779 by Perderabo on Monday 10th of January 2011 09:40:37 AM
Old 01-10-2011
Do a "stty -a". Isn't a cntl-D your eof character? eof means "end of file". You are not supposed to continue reading after eof. You could try to reopen the terminal with "exec < /dev/tty".
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash and Perl interaction questions

hi. i´m working in bash and am trying to create a Perl daemon that controls bash´s behavior. this is actually in preparation for a later project i´ll be working on. basically, i´m looking for a way to have the Perl daemon tell bash what to do. i already have a small daemon that simply prints... (2 Replies)
Discussion started by: deryk
2 Replies

2. Shell Programming and Scripting

Strange behavior from 'read' statements. (ksh - but could be same on other shells)

I'm getting rather frustrated with an interactive script I'm writing. The script is divided up, with section for setting variable at the top, then functions (which make up most of the script) then basically a line at the end which calls the first function- the program moves between the... (5 Replies)
Discussion started by: alexop
5 Replies

3. Shell Programming and Scripting

ksh and awk interaction

in a ksh script, i want to process some string variables using awk, and then i want to go on using this variables in the same ksh (out of awk lines) can anybody send me a very simple example about this? (0 Replies)
Discussion started by: gfhgfnhhn
0 Replies

4. Shell Programming and Scripting

Strange parameter passing problems (KSH)

Hi all, I'm having a rather peculiar problem involving parameter passing with declared functions in my shell script. Hope to get some advice here. A brief description of my code is as follows: However, I'm not getting the results I wanted. If I pass in $rdir, I'm going to end up... (4 Replies)
Discussion started by: rockysfr
4 Replies

5. UNIX for Dummies Questions & Answers

Longer commands and strange behaviour on ksh

Hi, I was trying to customize this archaic HP-UX box. only shell available is ksh and that too seems to be pretty old and doesn't completely conform to what I read on the web about ksh. Anyway here are my issues: - I wanted to have a dynamic title on xterm or dtterm. I put the following lines... (2 Replies)
Discussion started by: anurags
2 Replies

6. UNIX for Advanced & Expert Users

Strange KSH behaviour - any comments?

As you are probably aware, $# indicates the number of parameters passed into a korn shell script. But this appears to hang around for sunsequent runs...???? A simple script:- #!/usr/bin/ksh echo "#parameters $#" echo "\$1 $1" echo "\$2 $2" I run the script with 0 parameters (all fine) #... (7 Replies)
Discussion started by: gsw_aix
7 Replies

7. Shell Programming and Scripting

strange ksh arithmetic

Hello, I would like to understand this... I'm using ksh and doing (( z = y - 1 )) if y=34, then the result for z is 33, but if y=034 the result is z=27. Why?? Thanks (15 Replies)
Discussion started by: fbg
15 Replies

8. Shell Programming and Scripting

Strange behaviour with perl i/o?

Hi All, I got a strange problem here. I have a perl script which is fetching data from a database table and writing a file with that data. If i run that script from linux command line, the file it creates is a normal ascii text file without any binary character in it.But... (9 Replies)
Discussion started by: DILEEP410
9 Replies

9. Shell Programming and Scripting

[Perl] Strange problem with array

Hi, I have a strange problem with arrays in Perl. That is to say, for me it is strange and perhaps there is a special reason for it that I do not know of. Not a real Perl Ace. This is the program, as an example: #!/usr/bin/perl -w #-d use strict; my $pu; my $pu_list_cmd; my... (2 Replies)
Discussion started by: ejdv
2 Replies
ZZIP_DISK_FOPEN(3)					       zziplib Function List						ZZIP_DISK_FOPEN(3)

NAME
zzip_disk_fopen, zzip_disk_entry_fopen, zzip_disk_fread, zzip_disk_fclose, zzip_disk_feof - openening a file part wrapped within a (mmapped) zip archive SYNOPSIS
#include <zzip/mmapped.h> zzip__new__ ZZIP_DISK_FILE * zzip_disk_fopen((ZZIP_DISK * disk, char *filename)); zzip__new__ ZZIP_DISK_FILE * zzip_disk_entry_fopen((ZZIP_DISK * disk, ZZIP_DISK_ENTRY * entry)); zzip_size_t zzip_disk_fread((void *ptr, zzip_size_t sized, zzip_size_t nmemb, ZZIP_DISK_FILE * file)); int zzip_disk_fclose((ZZIP_DISK_FILE * file)); int zzip_disk_feof((ZZIP_DISK_FILE * file)); DESCRIPTION
The zzip_disk_fopen function opens a file found by name, so it does a search into the zip central directory with zzip_disk_findfile and whatever is found first is given to zzip_disk_entry_fopen the ZZIP_DISK_FILE* is rather simple in just encapsulating the arguments given to the zzip_disk_entry_fopen function plus a zlib deflate buffer. Note that the ZZIP_DISK pointer does already contain the full mmapped file area of a zip disk, so open()ing a file part within that area happens to be a lookup of its bounds and encoding. That information is memorized on the ZZIP_DISK_FILE so that subsequent _read() operations will be able to get the next data portion or return an eof condition for that file part wrapped in the zip archive. The zzip_disk_fread function reads more bytes into the output buffer specified as arguments. The return value is null on eof or error, the stdio-like interface can not distinguish between these so you need to check with zzip_disk_feof for the difference. The zzip_disk_fclose function releases any zlib decoder info needed for decompression and dumps the ZZIP_DISK_FILE* then. The zzip_disk_feof function allows to distinguish an error from an eof condition. Actually, if we found an error but we did already reach eof then we just keep on saying that it was an eof, so the app can just continue. AUTHOR
o Guido Draheim <guidod@gmx.de> COPYRIGHT
Copyright (c) 2003,2004,2006 Guido Draheim All rights reserved, use under the restrictions of the Lesser GNU General Public License or alternatively the restrictions of the Mozilla Public License 1.1 zziplib 0.13.62 ZZIP_DISK_FOPEN(3)
All times are GMT -4. The time now is 06:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy