examples: fix shellcheck warnings in wps-ap-cli

Message ID 0267dd6c5b378fe67e3278aac9c63a6b094f6768.1536577183.git.davide.caratti@gmail.com
State Accepted
Headers show
Series
  • examples: fix shellcheck warnings in wps-ap-cli
Related show

Commit Message

Davide Caratti Sept. 10, 2018, 11 a.m.
use 'printf' instead of 'echo -n', to suppress the following warning:

In POSIX sh, echo flags are undefined. [SC2039]

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
---
 wpa_supplicant/examples/wps-ap-cli | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jouni Malinen Nov. 22, 2018, 3:01 p.m. | #1
On Mon, Sep 10, 2018 at 01:00:36PM +0200, Davide Caratti wrote:
> use 'printf' instead of 'echo -n', to suppress the following warning:
> 
> In POSIX sh, echo flags are undefined. [SC2039]

Thanks, applied.

Patch

diff --git a/wpa_supplicant/examples/wps-ap-cli b/wpa_supplicant/examples/wps-ap-cli
index cc2cff2eb..15d913ef1 100755
--- a/wpa_supplicant/examples/wps-ap-cli
+++ b/wpa_supplicant/examples/wps-ap-cli
@@ -14,12 +14,12 @@  pbc()
 enter_pin()
 {
 	echo "Enter a PIN from a station to be enrolled to the network."
-	echo -n "Enrollee PIN: "
+	printf "Enrollee PIN: "
 	read pin
 	cpin=`$CLI wps_check_pin "$pin" | tail -1`
 	if [ "$cpin" = "FAIL-CHECKSUM" ]; then
 		echo "Checksum digit is not valid"
-		echo -n "Do you want to use this PIN (y/n)? "
+		printf "Do you want to use this PIN (y/n)? "
 		read resp
 		case "$resp" in
 			y*)
@@ -52,7 +52,7 @@  main_menu()
 	echo "3: Show current configuration"
 	echo "0: Exit wps-ap-cli"
 
-	echo -n "Command: "
+	printf "Command: "
 	read cmd
 
 	case "$cmd" in