Using -C <n> option, print the search result of the word "pajamas" with 1 line before and 1 line after it from the file /tmp/file.txt.
Grep useful options
Display the context
Report a typo
Sample Input 1:
I made myself a snowball
As perfect as could be.
I thought I’d keep it as a pet
And let it sleep with me.
I made it some pajamas
And a pillow for its head.
Then last night it ran away,
But first it wet the bed.Sample Output 1:
And let it sleep with me.
I made it some pajamas
And a pillow for its head.Write a program in Shell
#!/usr/bin/env bash
solve() {
# add your solution here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.