Question
Two pipes, A and B, can independently fill the tank in
15 minutes and 20 minutes respectively, while pipe C can empty 7 gallons from the tank in 2 minutes. If all three pipes are operated simultaneously, and they manage to fill the tank in 12 minutes, what is the tank's capacity?Solution
Taking LCM of 15, 20 and 12 = 60 Efficiency of A = 4 Efficiency of B = 3 Efficiency of (A+B-C) = 5 Efficiency of C = (4 + 3) – 5 = -2 Pipe C empty the tank in = 60/2 = 30 min Capacity of the tank = 30 × (7/2) = 105 gallons
Which construct allows embedding a block of text in shell scripts as input?
Extended globbing in bash allows:
In shell scripting, $1 represents:
How do you check the exit status of the last executed command in a shell?
Which command is used to read user input from the keyboard and store it in a variable?
In bash, which command is used to trap and handle signals like SIGINT?
Which command is used to search for a pattern in files?
To check if a file /tmp/data.txt is both readable and writable by the current user in a shell conditional, which test is correct?
Which command safely iterates over filenames that may contain spaces and newlines in a shell script?
Which command is used to display the contents of a file in Linux?