LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   CLI - FIND command installing software update (https://www.linuxquestions.org/questions/linux-newbie-8/cli-find-command-installing-software-update-4175539913/)

smileybri 04-16-2015 12:42 PM

CLI - FIND command installing software update
 
So I extract an update to a package that creates one of the folders below and then I run "$(find . -name install.sh)" to find and install the update. It seems to go just fine. How? If the other versions were also there? Which install.sh gets run?

# find -name install.sh
./Program_5.1.8341.5506_Install/install.sh
./Program_5.0.8132.5459_Install/install.sh
./Program_5.2.8724.5567_Install/install.sh
./Program_5.1.8473.5522_Install/install.sh

John VV 04-16-2015 12:50 PM

whatever one YOU select

veerain 04-16-2015 12:51 PM

See install script which unpacks and runs.

suicidaleggroll 04-16-2015 02:24 PM

Quote:

Originally Posted by smileybri (Post 5348468)
I run "$(find . -name install.sh)" to find and install the update.

find does not install anything. It does exactly what its name implies, it just finds all files that match the parameters you gave it (-name install.sh) and prints them out.

Quote:

Originally Posted by smileybri (Post 5348468)
Which install.sh gets run?

None of them.

edit: Actually I see you ran "$(find . -name install.sh)" rather than "find . -name install.sh". In that case it will likely run the first one it finds. You're much better off separating the find and the execution:
Code:

find . -name install.sh
Pick the one you want, and then run it
Code:

./Program_5.2.8724.5567_Install/install.sh

rknichols 04-16-2015 03:27 PM

Quote:

Originally Posted by suicidaleggroll (Post 5348527)
Actually I see you ran "$(find . -name install.sh)" rather than "find . -name install.sh". In that case it will likely run the first one it finds.

It will run the first one it finds, passing all the rest as arguments. Depending on what that script does with its arguments, the result might be "interesting".


All times are GMT -5. The time now is 07:11 AM.