<pre>
use sybsystemprocs
go

if exists (select * from sysobjects where name = "sp_unix" and type = 'P')
   drop proc sp_unix
go

create procedure sp_unix @param char(12) = NULL
as

-- sp_unix.sql: quick hack on sp_who to provide more useful info
-- Tim Peterson, AT&T (dpc1!tim@DPS0.ATTMAIL.COM)

select substring(l.name,1,8) ID, substring(p.hostname,1,4) HOST, 
p.hostprocess UNIX_PID, p.spid SPID, substring(p.status,1,10) STATUS, 
substring(p.cmd,1,16) CMD, p.blocked BLOCK, substring(d.name,1,8) DB
from sysprocesses p, sysdatabases d, syslogins l
where l.suid = p.suid
and d.dbid = p.dbid  

grant execute on sp_unix to public
go
