Pls help: Misc questions

Pls help: Misc questions

Post by Wong Siu » Sat, 15 Aug 1992 19:04:17



Hi all,

Hope that this's not FAQ's.

I want to know if HP-UX (8.07) has the re_comp and re_exec regular
expression handler calls.  I'm compiling pathalias (version 11) on my
HP720 and found that these calls are undefined.  I've installed this
software on a DECstation 5000/200 and everything's fine.  Is there any
work around ?

I also want to know how can I determine whether a process (say, "sh") is
a background job or an interactive one.  I submit jobs to a batch queue
(managed by NQS, a batch job managing system) which acts as if the user
logs in the system before executing the job.  I don't want several
commands in the .profile to be executed in this situation.  I hope that
the determination can be made somewhere in the process (probably a shell
script) itself, without the help of any external program.

Would anyone pls help ?

Any response will be much appreciated.

Thanks.
--
----------------------------------------------------------------------------



 
 
 

Pls help: Misc questions

Post by System Admin (Mike Peters » Sun, 16 Aug 1992 03:08:57



Quote:

>I also want to know how can I determine whether a process (say, "sh") is
>a background job or an interactive one.  I submit jobs to a batch queue
>(managed by NQS, a batch job managing system) which acts as if the user
>logs in the system before executing the job.  I don't want several
>commands in the .profile to be executed in this situation.  I hope that
>the determination can be made somewhere in the process (probably a shell
>script) itself, without the help of any external program.

You can try the 'tty -s' command, but that doesn't always work (it will
always be true for every shell run under a login shell, even if you
put it into the background and logout), but this method is probably OK
for use in the .profile itself.

The method we are using in the .kshrc (which is run for every ksh)
at the moment is:

if [ "$LEVEL" = "" ]; then
   let "LEVEL = 0"
fi
if [ "$PS1" != "" -a "$LEVEL" = "0" ]; then
   interactive=yes
else
   interactive=no
fi
let "LEVEL = $LEVEL + 1"
export LEVEL

(do this before you set the prompt to something other than the null
string). This method works by empirical observation, and could be
broken at any time by HP. A reliable method to do this is ABSOLUTELY
REQUIRED, though a better solution would be for HP to fix their
brain-damaged 'stty' command to not cause the shell to abort/hang
when not run in an interactive shell.
--
What are the chances that any computer system will ever "work" properly?
... and Slim just left town. -*- Mike Peterson, SysAdmin, U/Toronto Chemistry

 
 
 

Pls help: Misc questions

Post by Daniel B. Suthe » Sun, 16 Aug 1992 06:27:35




>>I also want to know how can I determine whether a process (say, "sh") is
>>a background job or an interactive one.  I submit jobs to a batch queue

In SysV, it's

if [ -t 0 ] ; then
    echo "Yup, file descriptor zero is associated with a terminal." >&2
    echo "It's interactive." >&2
else
    echo "Nope, this program's running in the background, from cron, etc." >&2
fi

This works well for any program that needs to prompt for information.  The idea
is to check before prompting.

Daniel B. Suthers,  CCP.
Technology Consultant, PCS & IN Development Lab,        Pac*Bell
Voice: (510) 671-1325               UUCP:  pacbell!pbeos!dbsuthe
================================================================================
=  Commit unexpected kindness and senseless acts of beauty.                    =
================================================================================

 
 
 

Pls help: Misc questions

Post by Calvin Hayden x22 » Sat, 22 Aug 1992 21:27:09



Quote:> Hi all,

> Hope that this's not FAQ's.

> I want to know if HP-UX (8.07) has the re_comp and re_exec regular
> expression handler calls.  I'm compiling pathalias (version 11) on my
> HP720 and found that these calls are undefined.  I've installed this
> software on a DECstation 5000/200 and everything's fine.  Is there any
> work around ?

Depends...  Do you have just the runtime system, or a full blown development
system (or one of the in betweens)?  HP/UX runtime system only comes with a
subset of the commands that makes unix unix (in my opinion).  For instance,
it does not include lex, yacc, sccs, lint, or many of the online man pages for
C function calls.  If you have man pages, try looking for regexec or regcomp,
or possibly regex and regcmp.  We basically found out - much to our dismay -
that to get everything that we felt needed to be in a "unix" system, that we
had to purchase their ANSI C Developers bundle on top of the basic runtime OS.
In our case, we are running 8.05 on a 720.  From looking at the time stamps on
the man page files, it looks like the at least the man pages were added as part
of one of HP's "extras", and not as part of the runtime distribution.
Their levels of software are something like this...

    HP/UX 8.xxx Runtime
      General Programming Tools (sccs, rcs, ...)
        Developers Toolkit (General pgm tools, Starbase/X/Motif prg tools)
          Ansi C Developers Bundle (ANSI C, lint, lex, yacc, etc...,
                                    plus anything you get in the above
                                    two subsets)

Real pain in the *ss way to do things if you ask me.  Getting this information
out of them was also a pain.

My opinions...

Calvin
--
Calvin Hayden                   Uucp: uunet!tijc02!cgh018        


 
 
 

1. Misc newby questions, please help

Hi guys,

I just installed OpenBSD on my machine (an old Sun SparcStation 1+)
after growing tired of NetBSD. NetBSD seems to be badly broken, while
things seem to compile under openbsd, which is a good start.
Completely new to BSD, but been using Linux for around 2 or 3 years.

I just wanted to sort of touch base, and get some advice on a few
things:

* Documentation - Linux has a pretty good collection of HOWTOs. All I
have found for OpenBSD is man pages and a general faq, with other
snippets here and there. Am I missing something?

* In the FAQ it says something about a UKC prompt for sending
arguments to the kernel. How do I get to this on my SS1+? Have tried,
some step-by-step instructions would be great.

* I tried to get the NIS client working with my NIS server on linux.
When booting, it says "domain not set. Aborting", and stops booting!
How can I get it to skip this, or run in a single user mode or
something to fix the domain setting? There must be a way to bypass it
and get to a console to fix the domain.

* There appears not to be any binary package system, all source? Is
this correct? Binaries are a very attractive options on a 25Mhz SPARC!

They're my specific issues now... but basically, I'm just starting out
and will take a while to get on top of this all. Can anyone make any
suggestions as to advice, documentation, etc? Does anyone volunteer to
hold my hand via email/ICQ or something, would be hugely greatful for
this.

Think that's all for now.

KimS

2. Network Terminal Servers

3. ifconfig question!!! pls help

4. UFS compatibility between x86 and SPARC

5. Beginner question..pls help

6. AT&T Unix Software

7. Pls help answer some setup questions

8. HELP: problems /lib and compressing

9. XPSCCS question... Pls. help

10. Novice questions: misc shell questions

11. URGENT! Unix question, pls help!

12. ATT: Pls help having problems with RH 6.2 (Newbie Question)

13. some newbie questions on Linux/XF86, pls help!