Mailinglist Archive: opensuse (1786 mails)

< Previous Next >
[opensuse] question on if clause formatting
I am trying to set up ssh, and I find different command line examples on the internet to help in my research. As I am learning CLI and scripting, can someone explain the following to me please?

In a given directory, I typed in the following line.

if [ ! -f authorized_keys ]; then touch authorized_keys ; chmod 600 authorized_keys ; fi

It created the file authorized_keys and gave it the time stamp and changed the permission. I got that part.

The only thing I don't understand is the very first boolean clause after the "if".

What exactly does the exclamation mark signify?

What also is the "-f" option?

Thanks
George
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >