IBM
C4040-227 · Question #218
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
(49 responses)- A10% (5)
- B82% (40)
- C2% (1)
- D6% (3)
Community Discussion
No community discussion yet for this question.