-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
London | Nadika Zavodovska | Module-Tools | Sprint 2 | Shell-Pipelines #34
base: main
Are you sure you want to change the base?
Changes from all commits
eb995f8
6ad567f
de8aa00
c19424b
722a070
7d96851
142f205
1046465
77f7163
8866c09
140da3b
fe559e7
5199bd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ set -euo pipefail | |
# The author got feedback that they're using too many exclamation marks (!). | ||
# | ||
# TODO: Write a command to output the contents of text.txt with every exclamation mark (!) replaced with a full-stop (.). | ||
|
||
cat text.txt | tr '!' '.' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: this works well, but could we allow There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a great question, and it's a new insight for me. Yes, we can access the file without using the cat command by running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: This works well, but can we find the nth row of a file more efficiently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your great question, @ehwus Alex. I think
sed -n '2p'
is faster thanhead -n 2 | tail -n 1
because it prints the second line directly without extra steps, making it simpler and better for large files.