Linux String Substitute (sed)

I believe task completed successfully, But it showing failed .

I have attached the output of search pattern for “distribution” with no match in file BSD_DELETE.txt

Hi dineshtobe,

Have you verified if modified in a correct file.

Just now I verified and am able to complete the task without any issues.

hi team,

i did the same , i attached the file already for your reference

please update the status

Hello ,
I have got the same problem than other guys here , I completed the task and it marks failed . I don’t understand why . You should sort out this problem .
ThanksLinux_string_substitute

Hi @dineshtobe

After reviewing your answer we found that you simply deleted the asked word from the file but in the question you were asked to delete the whole line containing the word, hence your answer was marked as failed.

Hi @bagam_fleury

After reviewing your answer we found that you also deleted line having same word but in CAPITAL. Since in the question you were only asked to delete the lines containing the word software but not SOFTWARE so answer was marked as failed.

1 Like

Hi Inderjeet,

My task also shows failed, i’m sure i did it write. please review my task.

=============

Hi @san,
You modified the original file (BSD.txt) by using ‘-i’ option in the sed command, and this affected the result.

1 Like

Hello Team,

Even myself faced the same issue .

Hi @Inderpreet, @kodekloud-support3,

Please review my task submission. I feel that the task description was poorly worded, and that I executed the task correctly based on literal interpretation of the task description (“Delete all lines containing word distribution” - so I respected word boundaries) but, based on the failure, I assume the verification method was based on string evaluation (I left instances of Redistribution because the task did not state to delete all lines containing the string distribution, which can exist as a “substring” - there’s no such thing as a “subword” as far as I’m aware). I actually debated whether I should respect word boundaries in my sed command because I was concerned about how the task would be verified…

It would be easy to say that I misinterpreted the word “word”, and should have thought “string”, but there’s a difference between the two, especially when the task description uses “containing word” in the instructions for BSD_DELETE.txt and “occurrence of string” in the instructions for BSD_REPLACE.txt - that implies that these two words/strings should be treated differently…

Thanks,
Peter

1 Like

Same here. I too left the redistribution words in the file, but failed. Was your exercise marked as passed?

1 Like

No, it’s still marked as failed. I assume someone from KodeKloud will respond to this post and state whether my solution is acceptable and either update their verification code to match the wording or change the wording of the exercise to reflect that they want all lines with the string “distribution” to be deleted to avoid confusion for others in the future…

I got this result :Make sure to replace all the occurences of or to their in /home/BSD_REPLACE.txt on stapp03. But I think i did’t right.
Please advise

Hi San,
I get permission denied while running same commands.
Please check and comment.


Thanks,
Swaroop

@Inderpreet @vijin.palazhi @rahulsoni


where i am going wrong?
Thanks,
Swaroop

Hi @swaroopcs88,

Check the permissions on the directory you’re attempting to write to…

-Peter


I don’t have execute permission on the root directory.

You’re looking at the files in the directory - not the actual directory’s permissions…

Try “ls -ld .”

You should see that you don’t have write permissions to that directory as user “banner”.

image