Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SYS(30) Problem

Status
Not open for further replies.

kgrix

Programmer
Joined
Apr 6, 2007
Messages
3
Location
US
I've been writing code on a Unix Foxpro 2.6 platform for some 12 years and all of a sudden today I have two users that logged in as usual - when in the Foxpro command window, typing SYS(30) returns "root" as the login name of that user.

That scared the crap out of my boss and I don't have any idea what the problem is, or where to look.

Is it a Unix problem or a Foxpro problem ???

Please Help !!!
 
A quick Google search revealed at least a couple of things:

Sys(30) is a Unix command, not a FoxPro command

A substitute for sys(30) is getenv('LOGNAME')

I hope that helps!

Teresa

 
I typed the command:
store getenv('LOGNAME') to m_login
and it did return the correct data (cs005).

I may just change my program to use that instead of the one I have been using for years:
store sys(30) to m_login

That is interesting, but let me make sure I am perfectly clear where I'm at.

After logging into Unix as "cs005" and checking my unix environment (env) - LOGNAME=cs005,

I then type foxpro -o -i -e -t to get to the Foxpro command window. From the Foxpro command window, I type the command ?sys(30) and it displays "root" on my screen. This has been working flawlessly for 10+ years - what could be going wrong all of a sudden.

I'm wondering if there is a problem and this is the first sign of it.

 
This has been working flawlessly for 10+ years - what could be going wrong all of a sudden.

Since there is no Sys(30) in FoxPro, I can only guess that someone was feeling clever and wrote a sys() function to mimic the one in Unix. Something most of us know can easily come back and bite you.

I'm wondering if there is a problem and this is the first sign of it.

If my guess is correct, I would not be surprised.

pamela
 
Kgrix,
Do not know if SYS(0) will work in UNIX but you can try it.

cUserName=ALLTRIM(SUBSTR(SYS(0),AT("#",SYS(0))+1))


David W. Grewe (Dave)
 
Have you upgraded your Unix operating system recently?

There is a documented issue with sys(30) & Red Hat.

 
Hey All,

Thanks for all your comments.

Cricket - we have upgraded our Unix operating system for the daylight savings change and since then, this problem has been occuring.

What I was wondering about was your comment about the documented issue with sys(30) & Red Hat. Where can I read up on that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top