![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File Descriptors + cron | matrixmadhan | UNIX for Advanced & Expert Users | 7 | 05-23-2007 01:53 PM |
| Sockets and File descriptors | gstlouis | High Level Programming | 3 | 12-12-2005 07:36 AM |
| file descriptors | a25khan | UNIX for Dummies Questions & Answers | 3 | 01-27-2004 07:46 PM |
| File Descriptors | shibz | UNIX for Advanced & Expert Users | 3 | 12-18-2002 10:12 AM |
| File Descriptors | s_chordia | High Level Programming | 2 | 12-24-2001 11:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
File descriptors problem perplexing me
Greetings,
I have a troubling problem with a Korn Shell concept that I know works in Solaris. Essentially I am assigning file descriptors to a coprocess. Also, it should be noted that I am not using the public domain ksh but, rather AT&T ksh93. Here is a test scenario: $ sqlplus -s /nolog |& <== Coprocess [1] 8566 $ print -p "prompt Hello" $ read -p line $ print $line Hello <== proof that the async communication works $ exec 5>&p <== assign fd 5 to stdout and fd 6 to stdin $ exec 6<&p $ print -u5 "prompt Hello again" <== This works in Solaris but not in Linux ksh: print: bad file unit number <== I don't know why this is occurring [1] + Done sqlplus -s /nolog |& <== coprocess dies $ read -u6 line $ print $line $ ulimit -a address space limit (kbytes) (-M) unlimited core file size (blocks) (-c) 0 cpu time (seconds) (-t) unlimited data size (kbytes) (-d) unlimited file size (blocks) (-f) unlimited locks (-L) unlimited locked address space (kbytes) (-l) 32 nofile (-n) 65536 <== Should be enough fds available nproc (-u) 16384 pipe buffer size (bytes) (-p) 4096 resident set size (kbytes) (-m) unlimited socket buffer size (bytes) (-b) 4096 stack size (kbytes) (-s) 10240 threads (-T) not supported process size (kbytes) (-v) unlimited Any ideas why I can't do this in Linux? Regards, Thomas |
|
||||
|
Quote:
Thomas |
|
||||
|
Quote:
$ set -A RESULTS_ARRAY "Initial Value" 0 0 0 0 ... $ { ... some command producing output... } | while read LINE > do > ... > RESULTS_ARRAY[0]="Some new text" > RESULTS_ARRAY[1]=1 > ... > done $ print ${RESULTS_ARRAY[0]} Initial Value The variable's scope appears to be limited to within the while loop. This is probably basic but I could not determine the answer at 2 AM when I was struggling over it. This is when I discovered that I had been using pdksh rather than AT&T's. AT&T's corrected this and I quit persuing it. What technique do I use to broaden the variable's scope? I tried to export the variable with the same results. Thomas |
|
||||
|
Quote:
It may be easier to alter my code to avoide "while read" loops and go back to pdksh than to figure out my file descriptor problem. Thomas |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|