Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use linux/unix cut command to perform specified operations: Text file (scene1_v1

ID: 3748252 • Letter: U

Question

Use linux/unix cut command to perform specified operations:

Text file (scene1_v1.txt):

Scene 1

      [wind]
      [clap clap]
      [clap clap]
      [clap clap]
ARTHUR: Whoa there!
ARTHUR: Whoa there!
      [clap clap]
GUARD #1: Halt! Who goes there?
ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle
      of Camelot. King of the Britons, defeator of the Saxons, sovereign
      of all England!
GUARD #1: Pull the other one!
ARTHUR: I am. And this my trusty servant Patsy.
      We have ridden the length and breadth of the land in search of knights
      who will join me in my court of Camelot. I must speak with your lord
      and master.
GUARD #1: What, ridden on a horse?
ARTHUR: Yes!
GUARD #1: You're using cowbells!
ARTHUR: What?
GUARD #1: You've got two empty cowbells and you're bangin'
      'em together.
ARTHUR: So? We have ridden since the snows of winter covered this
      land, through the kingdom of Mercea, through--
GUARD #1: Where'd you get the cowbell?
ARTHUR: We found them.
GUARD #1: Found them? In Mercea? The cowbell's tropical!
ARTHUR: What do you mean?
GUARD #1: Well, this is a temperate zone.
ARTHUR: The pigeon may fly south with the sun or the house martin
      or the plumber may seek warmer climes in winter yet these are not
      strangers to our land.
GUARD #1: Are you suggesting cowbells migrate?
ARTHUR: Not at all, they could be carried.
GUARD #1: What -- a pigeon carrying a cowbell?
ARTHUR: It could grip it by the husk!
GUARD #1: It's not a question of where he grips it! It's a simple
      question of weight ratios! A five ounce bird could not carry a 1 pound
      cowbell.
ARTHUR: Well, it doesn't matter. Will you go and tell your master
      that Arthur from the Court of Camelot is here.
GUARD #1: Listen, in order to maintain air-speed velocity, a pigeon
      needs to beat its wings 43 times every second, right?
ARTHUR: Please!
GUARD #1: Am I right?
GUARD #1: Am I right?
ARTHUR: I'm not interested!
GUARD #2: It could be carried by an African pigeon!
GUARD #1: Oh, yeah, an African pigeon maybe, but not a European
      pigeon, that's my point.
GUARD #2: Oh, yeah, I agree with that...
ARTHUR: Will you ask your master if he wants to join my court
      at Camelot?!
GUARD #1: But then of course African pigeons are not migratory.
GUARD #2: Oh, yeah...
GUARD #1: So they couldn't bring a cowbell back anyway...
      [wind]
      [clap clap]
GUARD #2: Wait a minute -- supposing two pigeons carried it together?
GUARD #1: No, they'd have to have it on a line.
GUARD #2: Well, simple! They'd just use a standard creeper!
GUARD #1: What, held under the dorsal guiding feathers?
GUARD #2: Well, why not?

Step 3: - Use the cut command A. Using the delimiter , display the name of the characters who are speaking in scene1 v1.txt (make sure to ignore any lines that do not include the delimiter). Now use cut to only display the name of the characters that have had their lines altered from scene1 v1.txt to scene1 v2.txt. B.

Explanation / Answer

See my terminal log showing all details.

=>First I have created one filesample.txt(scene1_v1.txt) and added content to this file.

=>After that I executed command cut -d':' -f1 sample.txt  to get the characters who are speaking in

=>After that I executed the command to write this content to another file sample1.txt(scene1_v.txt) file.

=>For more details see the whole log.

Last login: Tue Sep 4 23:42:59 2018 from 10.20.100.78
root@ubuntu:~# ls
avall.zip CtrlSDatacentersLtd storage
CtrlSDataAssurance_4_4_0_SP_DBN_Client_Only.bin SGInstallation.log
root@ubuntu:~# mkdir test
root@ubuntu:~# ls
avall.zip CtrlSDatacentersLtd storage
CtrlSDataAssurance_4_4_0_SP_DBN_Client_Only.bin SGInstallation.log test
root@ubuntu:~# cd test
root@ubuntu:~/test# cat >sample.txt
^C
root@ubuntu:~/test# ls
sample.txt
root@ubuntu:~/test# vi sample.txt
root@ubuntu:~/test# cat sample.txt
nd]
[clap clap]
[clap clap]
[clap clap]
ARTHUR: Whoa there!
ARTHUR: Whoa there!
[clap clap]
GUARD #1: Halt! Who goes there?
ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle
of Camelot. King of the Britons, defeator of the Saxons, sovereign
of all England!
GUARD #1: Pull the other one!
ARTHUR: I am. And this my trusty servant Patsy.
We have ridden the length and breadth of the land in search of knights
who will join me in my court of Camelot. I must speak with your lord
and master.
GUARD #1: What, ridden on a horse?
ARTHUR: Yes!
GUARD #1: You're using cowbells!
ARTHUR: What?
GUARD #1: You've got two empty cowbells and you're bangin'
'em together.
ARTHUR: So? We have ridden since the snows of winter covered this
land, through the kingdom of Mercea, through--
GUARD #1: Where'd you get the cowbell?
ARTHUR: We found them.
GUARD #1: Found them? In Mercea? The cowbell's tropical!
ARTHUR: What do you mean?
GUARD #1: Well, this is a temperate zone.
ARTHUR: The pigeon may fly south with the sun or the house martin
or the plumber may seek warmer climes in winter yet these are not
strangers to our land.
GUARD #1: Are you suggesting cowbells migrate?
ARTHUR: Not at all, they could be carried.
GUARD #1: What -- a pigeon carrying a cowbell?
ARTHUR: It could grip it by the husk!
GUARD #1: It's not a question of where he grips it! It's a simple
question of weight ratios! A five ounce bird could not carry a 1 pound
cowbell.
ARTHUR: Well, it doesn't matter. Will you go and tell your master
that Arthur from the Court of Camelot is here.
GUARD #1: Listen, in order to maintain air-speed velocity, a pigeon
needs to beat its wings 43 times every second, right?
ARTHUR: Please!
GUARD #1: Am I right?
GUARD #1: Am I right?
ARTHUR: I'm not interested!
GUARD #2: It could be carried by an African pigeon!
GUARD #1: Oh, yeah, an African pigeon maybe, but not a European
pigeon, that's my point.
GUARD #2: Oh, yeah, I agree with that...
ARTHUR: Will you ask your master if he wants to join my court
at Camelot?!
GUARD #1: But then of course African pigeons are not migratory.
GUARD #2: Oh, yeah...
GUARD #1: So they couldn't bring a cowbell back anyway...
[wind]
[clap clap]
GUARD #2: Wait a minute -- supposing two pigeons carried it together?
GUARD #1: No, they'd have to have it on a line.
GUARD #2: Well, simple! They'd just use a standard creeper!
GUARD #1: What, held under the dorsal guiding feathers?
GUARD #2: Well, why not?


root@ubuntu:~/test# cut -d':' -f1 sample.txt
nd]
[clap clap]
[clap clap]
[clap clap]
ARTHUR
ARTHUR
[clap clap]
GUARD #1
ARTHUR
of Camelot. King of the Britons, defeator of the Saxons, sovereign
of all England!
GUARD #1
ARTHUR
We have ridden the length and breadth of the land in search of knights
who will join me in my court of Camelot. I must speak with your lord
and master.
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
'em together.
ARTHUR
land, through the kingdom of Mercea, through--
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
ARTHUR
or the plumber may seek warmer climes in winter yet these are not
strangers to our land.
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
question of weight ratios! A five ounce bird could not carry a 1 pound
cowbell.
ARTHUR
that Arthur from the Court of Camelot is here.
GUARD #1
needs to beat its wings 43 times every second, right?
ARTHUR
GUARD #1
GUARD #1
ARTHUR
GUARD #2
GUARD #1
pigeon, that's my point.
GUARD #2
ARTHUR
at Camelot?!
GUARD #1
GUARD #2
GUARD #1
[wind]
[clap clap]
GUARD #2
GUARD #1
GUARD #2
GUARD #1
GUARD #2


root@ubuntu:~/test# sample1.txt | stdbuf -o0 cut -d':' -f1 sample.txt
root@ubuntu:~/test# cat sample.txt
nd]
[clap clap]
[clap clap]
[clap clap]
ARTHUR: Whoa there!
ARTHUR: Whoa there!
[clap clap]
GUARD #1: Halt! Who goes there?
ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle
of Camelot. King of the Britons, defeator of the Saxons, sovereign
of all England!
GUARD #1: Pull the other one!
ARTHUR: I am. And this my trusty servant Patsy.
We have ridden the length and breadth of the land in search of knights
who will join me in my court of Camelot. I must speak with your lord
and master.
GUARD #1: What, ridden on a horse?
ARTHUR: Yes!
GUARD #1: You're using cowbells!
ARTHUR: What?
GUARD #1: You've got two empty cowbells and you're bangin'
'em together.
ARTHUR: So? We have ridden since the snows of winter covered this
land, through the kingdom of Mercea, through--
GUARD #1: Where'd you get the cowbell?
ARTHUR: We found them.
GUARD #1: Found them? In Mercea? The cowbell's tropical!
ARTHUR: What do you mean?
GUARD #1: Well, this is a temperate zone.
ARTHUR: The pigeon may fly south with the sun or the house martin
or the plumber may seek warmer climes in winter yet these are not
strangers to our land.
GUARD #1: Are you suggesting cowbells migrate?
ARTHUR: Not at all, they could be carried.
GUARD #1: What -- a pigeon carrying a cowbell?
ARTHUR: It could grip it by the husk!
GUARD #1: It's not a question of where he grips it! It's a simple
question of weight ratios! A five ounce bird could not carry a 1 pound
cowbell.
ARTHUR: Well, it doesn't matter. Will you go and tell your master
that Arthur from the Court of Camelot is here.
GUARD #1: Listen, in order to maintain air-speed velocity, a pigeon
needs to beat its wings 43 times every second, right?
ARTHUR: Please!
GUARD #1: Am I right?
GUARD #1: Am I right?
ARTHUR: I'm not interested!
GUARD #2: It could be carried by an African pigeon!
GUARD #1: Oh, yeah, an African pigeon maybe, but not a European
pigeon, that's my point.
GUARD #2: Oh, yeah, I agree with that...
ARTHUR: Will you ask your master if he wants to join my court
at Camelot?!
GUARD #1: But then of course African pigeons are not migratory.
GUARD #2: Oh, yeah...
GUARD #1: So they couldn't bring a cowbell back anyway...
[wind]
[clap clap]
GUARD #2: Wait a minute -- supposing two pigeons carried it together?
GUARD #1: No, they'd have to have it on a line.
GUARD #2: Well, simple! They'd just use a standard creeper!
GUARD #1: What, held under the dorsal guiding feathers?
GUARD #2: Well, why not?


root@ubuntu:~/test# cat sample1.txt
root@ubuntu:~/test# ls
myfile sample1.txt sample.txt
root@ubuntu:~/test# cat myfile
root@ubuntu:~/test# stdbuf -o0 cut -d':' -f1 sample.txt -f3 sample1.txt
cut: only one type of list may be specified
Try 'cut --help' for more information.
root@ubuntu:~/test# stdbuf -o0 cut -d':' -f1 sample.txt -f3 sample11.txt
cut: only one type of list may be specified
Try 'cut --help' for more information.
root@ubuntu:~/test# ./loop.sh | stdbuf -o0 cut -d':' -f1 sample.txt -f3 > sample1.txt
-bash: ./loop.sh: No such file or directory
cut: only one type of list may be specified
Try 'cut --help' for more information.
root@ubuntu:~/test# ./sample1.txt | stdbuf -o0 cut -d':' -f1 sample.txt
-bash: ./sample1.txt: Permission denied
nd]
[clap clap]
[clap clap]
[clap clap]
ARTHUR
ARTHUR
[clap clap]
GUARD #1
ARTHUR
of Camelot. King of the Britons, defeator of the Saxons, sovereign
of all England!
GUARD #1
ARTHUR
We have ridden the length and breadth of the land in search of knights
who will join me in my court of Camelot. I must speak with your lord
and master.
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
'em together.
ARTHUR
land, through the kingdom of Mercea, through--
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
ARTHUR
or the plumber may seek warmer climes in winter yet these are not
strangers to our land.
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
question of weight ratios! A five ounce bird could not carry a 1 pound
cowbell.
ARTHUR
that Arthur from the Court of Camelot is here.
GUARD #1
needs to beat its wings 43 times every second, right?
ARTHUR
GUARD #1
GUARD #1
ARTHUR
GUARD #2
GUARD #1
pigeon, that's my point.
GUARD #2
ARTHUR
at Camelot?!
GUARD #1
GUARD #2
GUARD #1
[wind]
[clap clap]
GUARD #2
GUARD #1
GUARD #2
GUARD #1
GUARD #2
root@ubuntu:~/test# ls
root@ubuntu:~/test# ./loop.sh | stdbuf -o0 cut -d':' -f1 sample.txt -f3 > sample1.txt
root@ubuntu:~/test# cat sample1.txt
p clap]
[clap clap]
[clap clap]
ARTHUR
ARTHUR
[clap clap]
GUARD #1
ARTHUR
of Camelot. King of the Britons, defeator of the Saxons, sovereign
of all England!
GUARD #1
ARTHUR
We have ridden the length and breadth of the land in search of knights
who will join me in my court of Camelot. I must speak with your lord
and master.
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
'em together.
ARTHUR
land, through the kingdom of Mercea, through--
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
ARTHUR
or the plumber may seek warmer climes in winter yet these are not
strangers to our land.
GUARD #1
ARTHUR
GUARD #1
ARTHUR
GUARD #1
question of weight ratios! A five ounce bird could not carry a 1 pound
cowbell.
ARTHUR
that Arthur from the Court of Camelot is here.
GUARD #1
needs to beat its wings 43 times every second, right?
ARTHUR
GUARD #1
GUARD #1
ARTHUR
GUARD #2
GUARD #1
pigeon, that's my point.
GUARD #2
ARTHUR
at Camelot?!
GUARD #1
GUARD #2
GUARD #1
[wind]
[clap clap]
GUARD #2
GUARD #1
GUARD #2
GUARD #1
GUARD #2

root@ubuntu:~/test#