User command

Bob Stockler bob at trebor.iglou.com
Fri Mar 5 13:36:10 PST 2004


On Fri, Mar 05, 2004 at 02:46:17PM -0500, Howie wrote:
| 
| After all these years I am finally trying to use the USER command and
| something is wrong.
| 
| I am running rclerk version: 5.0.08R4
| The OS is: SCO_SV aljex 3.2 5.0.6 i386
| 
| I am trying to establish the tty of the user to create a unique filename so
| the processing table says:
| 
| user inp="tty"
| tt=inp
| show "@" & tt
| 
| the result of the show statement is:
| 
| ?[24;70H?[0m?[37m?[40m?[0m?[37m?[40m?[2J?[H?[0m?[37m?[40m?[2J?[H?[1;1H?[0m?[
| 37m?[40m?[2J?
| 
| Interesting but I expected something like "/dev/ttyp23"
| 
| Anyone know what is wrong?

Because you had the "tty" command within double quotes.

If you had not used the double quotes you'd have gotten:

  not a tty

because used in that way the standard input of the command
is not a terminal.

| Anyone have another way to establish the tty during processing?  I know I
| can set it into the environment but that takes forethought.

I set and export TTY in /etc/profile.

However, if you want to get it with USER, try:

  Then: USET inp = who am i
  Then: tt = inp

Here that returns:

  bob        ttyp11       Feb  7 16:27

a string you can parse for what you're after.

Bob

PS - On SCO UNIX . . . may be whoami on Linux.

-- 
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).


More information about the Filepro-list mailing list