(I think).
> I can't think of any syntax in list form that could replace this - and
> of course, I *do* need to replace it for the sake of hiding entries in
> the process table.

This is entirely pointless. It is generally trivial to find out which
file a process is executing anyway (I believe BSDish systems keep 'ls'
in the process table entry somewhere; linux has /proc/*/exe;
etc.). Either do whatever you need to do in Perl, without invoking
external commands at all, or arrange things so it doesn't matter if
people see what programs you're running.

Ben

--
"If a book is worth reading when you are six, *
it is worth reading when you are sixty." - C.S.Lewis

Advertisements

The problem there is that that's not a command followed by its
arguments; its a command, an argument and then _shell metacharacters_.
So you need a shellto execute - and with the multi-arg forms of system()
you're specifically not getting a shell, which means that thome
metacharacters aren't doing much.

Now, off the top of my head, how about:

system { 'sh' } 'secretls', '-c', 'ls -lR > 1 2>&1';

Because there you're executing sh(1) and giving it a string to parse...
Hang on I've just tried that and ps -Afw says:

pkent 12207 12206 1 23:18 pts/5 00:00:00 secretls -c ls -lR > 1
2>&1

which of course shows the args.

Actually, one thing you can do is open the relevant filehandles in perl
and do an exec() - no need to involve the shell at all! No need to use
redirection symbols! I think that the spawned ls(1) process would show
up but then it's a process, so it _has_ to show up.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!