I want to write 2 scripts that:
script named "users" - List of users logged into the system;
script named "ps" - List of all processes in the operating system;
# is it true?
#!bin/bash
echo 'content-type: text/html'
echo
users # for script named users
#!bin/bash
echo 'content-type: text/html'
echo
ps -a # for script named ps
but when i use another OS (Ubuntu). for script "users" - nothing to show, and
for script "ps" - just show "PID TTY TIME CMD"
is there anyone can help me?
#!/bin/bash => it's just my typing mistake here (in my CentOs - true)
to Corona688: scripts in CentOS: version 2.6.18
check html in Ubuntu: linux ubuntu 2.6.35-28
That's not an ubuntu problem in particular, it ought to have the same version of ps as most other Linux. You may be in a chroot or otherwise restricted, unable to access that sort of information/
---------- Post updated 04-01-12 at 01:49 AM ---------- Previous update was 03-31-12 at 07:28 PM ----------
you're true if using only one OC (in your case: Ubuntu). but i have to write scripts in CentOs and check it in Ubuntu. this cause a problem that i said above:wall:
so, ls /proc from your cgi scripts on both OSes show -rwxrwxrwx, only -rwxrwxrwx, and absolutely nothing but -rwxrwxrwx ? Very strange.
Again, I think this has nothing to do with centos vs ubuntu, but the way these systems have been configured. You appear to have been denied access to ps either accidentally or intentionally.
Can you clarify again what is the problem you are trying to solve ? You keep posting new screen-shots but there is nothing unexpected in them. Can you post another one (or better, just cut and pasted text with code tags) clearly exhibiting the issue and showing the context of the command ?