You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the section for documenting your work, the following code is run
history | tail -n 7
The output is
651 mkdir dc_workshop
652 mkdir dc_workshop/docs
653 mkdir dc_workshop/data
654 mkdir dc_workshop/results
655 ls -R
656 history
657 history | tail -n 7
The next step in the lesson is to redirect this output to an executable script so that the commands can be re-executed. However, the bash will return a command not found error because of the line numbers. This is a good opportunity to introduce the cut command by applying it to remove the line numbers. The command will be:
history | tail -n 7 | cut -d " " -f4-
The output
mkdir dc_workshop
mkdir dc_workshop/docs
mkdir dc_workshop/data
mkdir dc_workshop/results
ls -R
history
history | tail -n 7
history | tail -n 7 | cut -d " " -f 4-
The text was updated successfully, but these errors were encountered:
I also noticed this issue.
If introducing another command would add too much content, another way to address this would be to edit the instructions to read:
Next, remove any lines of the history that are not relevant by navigating to those lines and using your delete key. Also remove the line numbers preceding each command. Save your file and close nano.
Hi @ckigenk and @awnorowski - apologies for not getting back to you sooner, and thanks for your suggestions!
cut is a very useful command, but the main course is already quite long and I'm not sure there's time to cover it properly. Also, the cut command is currently introduced in an optional extra lesson, so we should probably avoid duplicating too much content.
If introducing another command would add too much content, another way to address this would be to edit the instructions to read:
Next, remove any lines of the history that are not relevant by navigating to those lines and using your delete key. Also remove the line numbers preceding each command. Save your file and close nano.
I think this is a good compromise - it makes explicit what learners need to do to ensure their script will work
In the section for documenting your work, the following code is run
The output is
The next step in the lesson is to redirect this output to an executable script so that the commands can be re-executed. However, the bash will return a
command not found
error because of the line numbers. This is a good opportunity to introduce thecut
command by applying it to remove the line numbers. The command will be:The output
The text was updated successfully, but these errors were encountered: