Solaris parent folder of client

(imported topic written by anthonymap91)

Is there a parent folder of client for SunOS. I wrote the following information for a spot audit, it works on all UNIX OS types minus SunOS. Whatam I missing? The task seems to complete successfully.

Thanks,

Anthony

Action1 (default)

Script Type BigFix Action Script

delete __appendfile

delete /tmp/task_userid.sh

appendfile #!/bin/sh

appendfile cat /etc/passwd > {pathname of parent folder of client}/userid-passwd.log

appendfile cat /etc/shadow > {pathname of parent folder of client}/userid-shadow.log

move __appendfile /tmp/task_userid.sh

wait /bin/sh -C /tmp/task_userid.sh

Analysis:

/etc/passwd

Period 1 day

lines of file “userid-passwd.log” of parent folder of client

l/etc/shadow

Period 1 day

lines of file “userid-shadow.log” of parent folder of client

(imported comment written by NoahSalzman)

I guessing that the /bin/sh on your Sun box is a “real gosh-darn original sh” not a sym link to /bin/bash. Doesn’t look like -C is a valid option for sh on SunOS.

  1. uname -a

SunOS jumpstart 5.10 Generic_118855-33 i86pc i386 i86pc

  1. echo $SHELL

/sbin/sh

  1. ls -l /bin/sh

ls -l /bin/sh

lrwxrwxrwx 1 root root 13 Jan 14 2010 /bin/sh -> …/…/sbin/sh

  1. /bin/sh -C

/bin/sh -C

-C: bad option(s)

System V represent!

(imported comment written by anthonymap91)

I am sorry, i do not understand how I address this. Is there a way to fix this?

Thanks

(imported comment written by NoahSalzman)

The problem is that the shell script you have written is not compatible with all Unix systems (or at least that is what I’m

speculating

is the problem).

One way to try and fix it would be to replace “/bin/sh” with “/bin/bash”. That will work if all the Unix systems have a /bin/bash.

Another solution is to wrap the “wait /bin/sh” line with an if statement that executes a separate version of that command but only for SunOS systems.