Which of the following commands will find in file \"foo\" these and only these l
ID: 3836444 • Letter: W
Question
Which of the following commands will find in file "foo" these and only these lines: BOB, Bob, BOb and BoB? In other words, it should not find other lines, e.g. bOB. A grap -i Bob foo B. grap 'B[o0][bB]' foo c. grap '[BOB]' foo D. grap "Bob" foo Write a bash script that 1) uses two file names as command-line arguments and 2) merges the content of two files into file "output.txt". For instance, "file 1" contains "Alice" and "file2" contains "Bob", and if we execute ./script.sh file1 file2, file output.txt should be "AliceBob". Answer: The bash script below is stored in a file "sum.sh". What will be the printout when executing ./sum.sh 12 34 ? #1/b in/bash a = $1 b = $2 echo $a + $b Answer: Write a grap command to match all human names in file "f infinity". In this problem, a valid human name is defined to contain the string of the first name, followed by a space, and then by the string of the last name. The string of first/last name must start with a capital letter and consist only of characters that are letters (i.e. no numbers, symbols, etc). For instance, "John Doe" is valid but "John doe". "John Doe-II" and "John Doe I" are invalid.Explanation / Answer
10.
#!/bin/bash
file1=$1
file2=$2
cat $file1 $file2 > output.txt
save this in file script.sh
run chmod +x script.sh
then run command as shown in question.
12.grep '^[A-Z][a-zA-z]* [A-Z][a-zA-z]*$' foo
it assume one line ocntain one name.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.