Find File command Syntax

(imported topic written by jstauf91)

I am new to BES but have a scripting background, but can’t quite get myself started on an inventory script for Solaris… I’ve got it running fine in a shell script I can execute manually, but the echo commands don’t always want to dump the information specified so I figured I’d try using the native code…

What I need to do is check to see if a folder exists and if so then check it for files. In shell this is written as:

if ; then

find /app/IBM -name “*.properties” > /var/tmp/ibm.prop

fi

The BES equivalent of this as far as I can tell would be:

if {(exists folder “/app/IBM”)}

names of find files “*.properties” of folder “/app/IBM” > /var/tmp/ibm.prop

endif

However I get an Invalid Action Script error telling me that it can not parse action script for Action4 line 3: Unknown action command.

Any ideas what I am doing wrong?

(imported comment written by NoahSalzman)

You can’t tell Action Script

itself

to redirect output to a file. However, you can run a shell command that happens to redirect output to a file.

if {(exists folder “/app/IBM”)}

run sh -c “find /app/IBM -name ‘*.properties’ > /var/tmp/ibm.prop”

endif

(imported comment written by Vyankey91)

I do not know anything about scripting nor programming. How do I start from the scratch as I have to handle this product responsibility in future time?