IBM
C4040-221 · Question #14
Within a Perl script, how can the output of the hostname command be assigned to a variable called myHostname?
The correct answer is B. chop($myHostname=%hostname -s 2>/dev/nuir). See the full explanation below for the reasoning.
Question
Within a Perl script, how can the output of the hostname command be assigned to a variable called myHostname?
Options
- AchopfmyHostname-'hostname -s 2>/dev/null")
- Bchop($myHostname=%hostname -s 2>/dev/nuir);
- C$myHostname=7usr/bin/hostname".
- Dchomp(@myHostname-hostname -s 2>/dev/null');
How the community answered
(27 responses)- A4% (1)
- B74% (20)
- C7% (2)
- D15% (4)
Community Discussion
No community discussion yet for this question.