I am having problem with the first question of exercise 4… Am I supposed to use sed command for changing the LARRY to LAERTES but it is not working out…Plz help
May I ask you to post here content of
Hamlet: Act 1, Scene 3
A room in Polonius’ house.
Enter LARRY and OPHELIA
My necessaries are embark’d: farewell:
And, sister, as the winds give benefit
And convoy is assistant, do not sleep,
But let me hear from you.
Do you doubt that?
For Hamlet and the trifling of his favour,
Hold it a fashion and a toy in blood,
A violet in the youth of primy nature,
Forward, not permanent, sweet, not lasting,
The perfume and suppliance of a minute; No more.
No more but so?
Hm, I thought that it might be a problem with tests, I have misunderstood the question, sorry.
According to the instructions you don’t really have to use
sed command, you can simply change all occurrences of
LAERTES by hand.
But if you want to, here is how to do this using
Make sure that you are in the right directory $ pwd /home/ccuser/workspace/hamlet-prince-of-denmark Use sed to find and replace $ sed -i -e 's/LARRY/LAERTES/g' scene-3.txt
-i - make changes in place
-e - we are going to define expression
's/LARRY/LAERTES/g - substitue (
s) all (
g) occurrences of
Please note that you have to close the file and open it again to see the changes. Or you can use
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.