cancel
Showing results for 
Search instead for 
Did you mean: 
chis
Mission Specialist
Mission Specialist
  • 358 Views

Chapter01s07

Jump to solution

I feel like this line could use some extra explanation, I saw nothing related to this in the preceding pages.

ssh ${USR}@${SRV} "grep -v '^$' /etc/selinux/config|grep -v '^#'" >> ${OUT}-${SRV}

Specifically

'^$' 

- I assume this is the expression that removes whitespaces, but how or why and where is this mentioned in the preceding guide.

If it is expected to do our own research, that is fine, but it does not suggest you should do this.

Please advise.

Thanks.

Labels (2)
1 Solution

Accepted Solutions
chis
Mission Specialist
Mission Specialist
  • 297 Views

Hi Chetan,

Thank you for providing further information.

I had conflicting understanding of the $ flag.

View solution in original post

4 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 351 Views

Hi @chis , thanks for the feedback, Let me check it and get back to you.

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 347 Views

ok @chis , I think you are talking about step 2.2 :

Chetan_Tiwary__0-1729526604864.png

The command grep -v '^$' /etc/selinux/config | grep -v '^#' searches the /etc/selinux/config file on the remote server for lines that are not empty and do not start with a # character (which usually indicates a comment). The -v option in both grep commands inverts the match, meaning it finds lines that don't match the specified patterns. This ensures that only non-empty, non-comment lines are extracted from the configuration file.

I will file an improvement request to ensure there is an explanation for this script in the course steps.

Thank you for this feedback!

 

0 Kudos
chis
Mission Specialist
Mission Specialist
  • 298 Views

Hi Chetan,

Thank you for providing further information.

I had conflicting understanding of the $ flag.

Chetan_Tiwary_
Community Manager
Community Manager
  • 285 Views

pleasure @chis !

0 Kudos
Join the discussion
You must log in to join this conversation.