Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check-inodes.sh script. #209

Merged
merged 9 commits into from
Jul 11, 2024

Conversation

jeffmcutter
Copy link
Collaborator

Output from running analysis role:

line 36: badinitio: unbound variable

Output testing script manually:

[root@satrhel6-1 ~]# /tmp/check-inodes.sh 
/tmp/check-inodes.sh: line 36: badinitio: unbound variable
[root@satrhel6-1 ~]# bash /tmp/check-inodes.sh 
/tmp/check-inodes.sh: line 36: exit: : numeric argument required

@jeffmcutter jeffmcutter requested a review from djdanielsson July 11, 2024 08:26
@jeffmcutter
Copy link
Collaborator Author

@djdanielsson Can you look at this one? #202 broke check-inodes.sh (see description above). Thanks!

Copy link
Collaborator

@djdanielsson djdanielsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum... I wondered if those changes would break it. I will have to figure out how to make it skip this in sanity check

Copy link
Collaborator

@djdanielsson djdanielsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try and fix this

Copy link
Member

@swapdisk swapdisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "unbound variable" error is because $badinitio is unset if the report shortfalls loop doesn't find any problems. It was fine until -u bash option was added. Per bash man page, that option tells bash to treat unset variables as an error...

-u   Treat unset variables and parameters other than the special para‐
     meters "@" and "*", or array variables subscripted  with  "@"  or
     "*",  as an error when performing parameter expansion.  If expan‐
     sion is attempted on an unset variable or  parameter,  the  shell
     prints  an  error  message, and, if not interactive, exits with a
     non-zero status.

Let me recommend we just add badinitio=0 before the loop at line 23 and we should be able to leave everything else as it was and not need to do the sanity test ignores.

@djdanielsson
Copy link
Collaborator

yep I figured that out and did just that

@djdanielsson djdanielsson merged commit 9d3f629 into redhat-cop:main Jul 11, 2024
20 checks passed
@jeffmcutter
Copy link
Collaborator Author

Pulled the latest main and ran analysis successfully on a RHEL 6 box. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants