Thomas Müller‘s iPhone
echo -e $(iwlist wlan0 scan | grep ESSID)
1 2 3 4 5 6 7
my $cmd = "echo -e $(iwlist wlan0 scan | grep ESSID)"; open my $pipe, '-|', $cmd or die "(E) could not execute: $cmd: $!\n"; while ( my $line = <$pipe> ) { print Dumper($line); } close $pipe;
1
2
3
4
5
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
echo -e $(iwlist wlan0 scan | grep ESSID) > /opt/wifiWebUI/temp/getWifiNets.dat
exit
1 2 3 4 5 6 7 8 9
my $cmd = "iwlist wlan0 scan"; open my $pipe, '-|', $cmd or die "(E) could not execute: $cmd: $!\n"; while ( my $line = <$pipe> ) { next if $line !~ m/ESSID/; # replace the "| grep ESSID" in the $cmd print Dumper($line); } close $pipe;
2021-02-23T22:29:39 cbxk1xgEs geht mir vor allem darum, daß ein encode("utf-8", $string); oder decode nicht funktioniert. Apostrophen und Emojis werden nicht richtig umgewandelt wenn ich es via Backticks oder System ausführe.
1 2 3
use Encode; my $octets = `iwlist wlan0 scan | grep ESSID`; my $characters = decode('UTF-8', $octets, Encode::FB_CROAK);
ESSID:"\\xF0\\x9F\\xA4\\xA1Markus\\xE2\\x80\\x98\\xF0\\x9F\\x92\\xA9iPhone\\xF0\\x9F\\x92\\x80"
1 2 3
my $octets = `iwlist wlan0 scan | grep ESSID`; my $characters = decode('UTF-8', $octets, Encode::FB_CROAK); print $characters, "\n";
2021-02-24T10:43:30 LinuxerCode: (dl )1
2
3
4[code=perl]
my $octets = `iwlist wlan0 scan | grep ESSID`;
my $characters = decode('UTF-8', $octets, Encode::FB_CROAK);
print $characters, "\n";
ESSID:"\xF0\x9F\xA4\xA1Markus\xE2\x80\x98\xF0\x9F\x92\xA9iPhone\xF0\x9F\x92\x80"
export DEBIAN_FRONTEND=noninteractive
echo $'\xF0\x9F\xA4\xA1'
1 2 3 4 5 6
use 5.020; use Encode; my $output = `iwlist wlan0 scan | grep ESSID`; my $octets = eval $output; my $characters = decode('UTF-8', $octets, Encode::FB_CROAK); say encode('UTF-8',$characters);
my $characters = decode('UTF-8', $octets, Encode::FB_CROAK);