« first day (4500 days earlier)      last day (469 days later) » 

10:32 AM
How do I find out the meaning of parameters for the if statement in bash?
I have:
if [-f someFile -o -d someOtherFile]; then ...
Obviously $man if does not work
how am I supposed to know what -o and -d mean here?
 
@LandonZeKepitelOfGreytBritn The if statement takes a command and runs it. It then executes branches (the true branch, ore th "else" branch) depending on the command's exit status.
In the case that you show, the command is actually [.
So what you are asking about i the options to the [ command.
You will find inforamtion about with "man ["
The "-o" option means "logical OR"
The "-d" option takes an argument that is a pathname, and evaluates to "true" if that pathname is a an existing directory.
 
@Kusalananda that will give the documentation for /sbin/[ not the shell builtin which is what is used in if [ whatever ];
 
Usually, we want to avoid the use of "-o" (and "-a" for AND) and instead write the test as if [ -f somefile ] || [ -d someDir ]
 
@LandonZeKepitelOfGreytBritn [ is an alias for the test builtin, so in bash you can see the documentation if you run help test.
 
Yeah, the [ command is often a built-in command in the shell and the exact use will be documented in the shell's manual.
@terdon Not a straight alias though. It requires a ] at the end.
 
10:42 AM
true, but takes the same options
 
So it is
 
 $ help [
[: [ arg... ]
    Evaluate conditional expression.

    This is a synonym for the "test" builtin, but the last argument must
    be a literal `]', to match the opening `['.
My Arch doesn't even have a man page for [, does your system have one?
 
OK thanks
Unrelated:
I get the following error sometimes: git is not clean, please run 'make mrproper'
Apparently this is because there is a .config file present. I find this very strange.
Because when you do make menuconfig (to eg configure a kernel or u-boot) the configuration gets saved into a .config file after which you run make to build everything
So why does having a .config present in some cases lead to the mrproper error?
isn't it normal and logical to have a .config file present?
 
It's unclear what gives this error. I assume you're building a Linux kernel? I'm not a Linux user so I have no clue about how it's supposed to work. You may want to ask a question about it on the main U&L site. Make sure you give a full description of what you're doing etc.
 
 
6 hours later…
5:05 PM
@LandonZeKepitelOfGreytBritn I think you'll need to get a reproducible test example if you want someone to explain this one for you.
And if you have a reproducible test example, you might be able to explain it yourself. :-)
 
 
4 hours later…
8:45 PM
Hello, if anyone can help me with this question please, it is related to Slurm: stackoverflow.com/questions/75339829/…
Thank you very much!
 
9:28 PM
I wish I knew more about slurm but only because it's fun to say
 
9:41 PM
Hehe
I'm in the dark with this problem :(
 
 
2 hours later…
11:53 PM
user image
3
 

« first day (4500 days earlier)      last day (469 days later) »