bash - Variable from conditional statement -


I have some scripts that I am taking ownership of that shell of that use, get a statement inside a conditional statement Are there.

Something like this:

  if [-z $ (/ -type f -perm-002 find)]; Then "any world could not be readable" echo  

Where else as found in place of I found world written perms instead of want to display Are there.

I can:

  $ echo ($ / / -type f -perm-002 Find) is allowed in the world  

or set the variable for $ (search / type-type f -perm-002) .

But it was thinking that there was a better way to do this. Is there another way to retrieve the contents of the search statement as a variable?

You take the output and store it in a variable if it is not empty then you can print its content can do. In this way you only need to run the command once.

  find RESULT = $ (/ -type f -perm-002) if [-z "$ RESULT"] then "no world is found to be writable" and echo "$ RESULT The world has permissions "fi  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -