Question
Train 'A' having a speed of 10 m/s can cross a man in 12
seconds. The length of train 'B' is 210 metres more than the length of 'A'. If the speed of 'B' is 50 m/sec and both trains are travelling towards each other, then find the time taken by them to cross each other.Solution
Length of train 'A' = 10 × 12 = 120 metres
Length of train 'B' = 120 + 210 = 330 metres
Relative speed = 10 + 50 = 60 m/sec
Required time = (120 + 330) ÷ 60 = 450 ÷ 60 = 7.5 seconds
What does $# represent in a shell script?
If a program needs to read data from a file, which system call would it typically use?
Which operator enables process substitution?
In bash, what does trap 'echo Exit' EXIT do?
Which symbol is used to comment a single line in shell scripts?
Which symbol is used in shell scripting to reference a positional parameter, e.g., the first argument passed to a script?
Which signal is sent by default when using kill without arguments?
Which operator is used for string equality comparison within `test` or `[` commands in shell scripting?
How can you pass command-line arguments to a shell script?
Which construct allows embedding a block of text in shell scripts as input?