Have the following code and i wish that the variable that store the system output to be places in a single variable. However a newline is printer at the end of each variableso i get the following when i print brand model size
#!/usr/bin/perl use strict; use warnings; my $dcr = "na"; my $dev= "/dev/sdc" ; my $brand = qx(/usr/bin/lsscsi | grep $dev |awk '{print \$4}' ) ; my $model = qx(/usr/bin/lsscsi | grep $dev |awk '{print \$5}' ) ; my $disk_size = `/sbin/parted $dev -s print | grep Disk | awk '{pr +int \$3}' `; $dcr = "$brand $model $disk_size"; print "$dcr";
In reply to System output variables and newline by Jocqui
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |