From: Shurik on 15 Mar 2010 12:02 Hi, I have the following function definition on HP-UX ( ksh shell ) function checkDB { sqlplus -s user/pass(a)inst<<END>>${HOME}/db_status set head off; set feedback off; set pagesize 0; set linesize 120; select 'CHECK DB CONNECTION' from DUAL; END grep 'CHECK DB CONNECTION' ${HOME}/db_status >/dev/null 2>&1 if [ $? -eq 0 ] then return 0 else return 1 fi } I see that after the definition created temp file in /tmp/ sh<process_id>.1 Why this file created? Can I change the temp location? Thanks
From: Sven Mascheck on 15 Mar 2010 13:25 Shurik wrote: > I have the following function definition on HP-UX ( ksh shell ) > > [here-document inside function] > > I see that after the definition created temp file in /tmp/sh<process_id>.1 Yes, this is a common behaviour of Bourne and Korn (ksh88) shells. > Can I change the temp location? No, except you want to "in-place" edit the compiled-in path in the ksh binary. However, there's a workaround: put the function body into "eval". function() { eval 'cat<<EOF EOF ' } -- http://www.in-ulm.de/~mascheck/bourne/common.html
From: Shurik on 15 Mar 2010 15:16 On Mar 15, 7:25 pm, Sven Mascheck <masch...(a)email.invalid> wrote: > Shurik wrote: > > I have the following function definition on HP-UX ( ksh shell ) > > > [here-document inside function] > > > I see that after the definition created temp file in /tmp/sh<process_id>.1 > > Yes, this is a common behaviour of Bourne and Korn (ksh88) shells. > > > Can I change the temp location? > > No, except you want to "in-place" edit the compiled-in path in the ksh binary. > > However, there's a workaround: put the function body into "eval". > > function() { > eval 'cat<<EOF > EOF > ' > > } > > --http://www.in-ulm.de/~mascheck/bourne/common.html Sven, thanks a lot, now I don't have temp file
From: Shurik on 16 Mar 2010 17:36 On Mar 15, 9:16 pm, Shurik <shurikgef...(a)gmail.com> wrote: > On Mar 15, 7:25 pm, Sven Mascheck <masch...(a)email.invalid> wrote: > > > > > > > Shurik wrote: > > > I have the following function definition on HP-UX ( ksh shell ) > > > > [here-document inside function] > > > > I see that after the definition created temp file in /tmp/sh<process_id>.1 > > > Yes, this is a common behaviour of Bourne and Korn (ksh88) shells. > > > > Can I change the temp location? > > > No, except you want to "in-place" edit the compiled-in path in the ksh binary. > > > However, there's a workaround: put the function body into "eval". > > > function() { > > eval 'cat<<EOF > > EOF > > ' > > > } > > > --http://www.in-ulm.de/~mascheck/bourne/common.html > > Sven, thanks a lot, now I don't have temp file I found that if I defined function as below function CheckDB ..... The temp file created, but if I use the other option for function definition CheckDB() ...... The temporary file doesn't created. Why?
From: Sven Mascheck on 16 Mar 2010 20:26 Shurik wrote: >>> [...] function definition on HP-UX ( ksh shell ) BTW: compare with sh, which is not a ksh88c but a ksh88f on HP-UX. > I found that if I defined function as below > > function CheckDB > .... > > The temp file created, but if I use the other option for function > definition > > CheckDB() > ..... > > The temporary file doesn't created. Later releases of ksh88 (e.g. 88i) create only one temp file, no matter how many functions are defined. The shell manages to sort out the respective parts. Do you rather experience a similar effect? I couldn't try on HP-UX, but I can't reproduce what you describe with some other ksh88 releases. -- http://www.in-ulm.de/~mascheck/various/shells/#hpux11
|
Pages: 1 Prev: Question: add a CC list to `mail` command Next: manning man |