Skip to main content
added 109 characters in body
Source Link
User051209
  • 690
  • 2
  • 8
  • 26

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each field value is separated from the others by a colon character (':'). In this way, the command output shows the Wi-Fi network SSID complete with all leading and the trailing spaces are present in the SSID.
  So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed (there are 2 columns SSID and SECURITY seprated by : char):

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is located between the beginning of the line and the character : character.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading spacespaces.


EDIT

As suggested by @Hans-Martin Mosner It is necessary to handle the case where the : character is contained in the SSID.
On my project the output of the nmcli command is processed by a script Python so by the split(':') method it is not difficult to get the SSID containing the character : possibly present.

Thank you to all

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each value is separated from the others by a colon character (':'). In this way the leading and the trailing spaces are present in the SSID.
  So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed:

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is between the beginning of the line and the : character.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading space.


EDIT

As suggested by @Hans-Martin Mosner It is necessary to handle the case where the : character is contained in the SSID.
On my project the output of the nmcli command is processed by a script Python so by the split(':') method it is not difficult to get the SSID containing the character : possibly present.

Thank you to all

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each field value is separated from the others by a colon character (':'). In this way, the command output shows the Wi-Fi network SSID complete with all leading and trailing spaces. So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed (there are 2 columns SSID and SECURITY seprated by : char):

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is located between the beginning of the line and the character :.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading spaces.


EDIT

As suggested by @Hans-Martin Mosner It is necessary to handle the case where the : character is contained in the SSID.
On my project the output of the nmcli command is processed by a script Python so by the split(':') method it is not difficult to get the SSID containing the character : possibly present.

Thank you to all

added 328 characters in body
Source Link
User051209
  • 690
  • 2
  • 8
  • 26

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each value is separated from the others by a colon character (':'). In this way the leading and the trailing spaces are present in the SSID.
So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed:

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is between the beginning of the line and the : character.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading space.


EDIT

As suggested by @Hans-Martin Mosner It is necessary to handle the case where the : character is contained in the SSID.
On my project the output of the nmcli command is processed by a script Python so by the split(':') method it is not difficult to get the SSID containing the character : possibly present.

Thank you to all

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each value is separated from the others by a colon character (':'). In this way the leading and the trailing spaces are present in the SSID.
So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed:

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is between the beginning of the line and the : character.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading space.

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each value is separated from the others by a colon character (':'). In this way the leading and the trailing spaces are present in the SSID.
So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed:

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is between the beginning of the line and the : character.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading space.


EDIT

As suggested by @Hans-Martin Mosner It is necessary to handle the case where the : character is contained in the SSID.
On my project the output of the nmcli command is processed by a script Python so by the split(':') method it is not difficult to get the SSID containing the character : possibly present.

Thank you to all

added 100 characters in body
Source Link
User051209
  • 690
  • 2
  • 8
  • 26

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each value is separated from the others by a colon character (':'). In this way the leading and the trailing spaces are present in the SSID.
So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed:

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is between the beginning of the line and the : character.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading space.

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each value is separated from the others by a colon character (':'). In this way the leading and the trailing spaces are present in the SSID.
So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed:

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is between the beginning of the line and the : character.

This method solve also the problem of the leading space.

By this post I have found the option --get-value of the command nmcli. For an explanation of the option see the documentation of the command nmcli.

By this option I can specify what fields must be present in the output, and each value is separated from the others by a colon character (':'). In this way the leading and the trailing spaces are present in the SSID.
So the command nmcli can be used as showed below:

> nmcli --get-value SSID,SECURITY dev wifi list

An example of the output of the command is the followed:

TPLINK-8853:WPA2
TPLINK-9910 :WPA2
GUESTS:
:WPA2 802.1X
...

The second line of the output is TPLINK-9910 :WPA2 and it is easy to get the SSID of the Wifi because it is between the beginning of the line and the : character.

In the output the fourth line (:WPA2 802.1X) shows an hidden wifi network (the SSID is empty).

This method solve also the problem of the leading space.

Source Link
User051209
  • 690
  • 2
  • 8
  • 26
Loading