Skip to main content
-e and -i are `bash` only.
Source Link
Stéphane Chazelas
  • 586.3k
  • 96
  • 1.1k
  • 1.7k

You want to use bash instead of sh and the -e and -i options toof its read builtin:

#!/bin/shbash - echo "@@@@@@@@@@ @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]: @@@@@@@@@@" read -i "our-platform-7.26-2.17-res4" -e SuggestDefaultPlatform echo "you chose $SuggestDefaultPlatform" 

From help read in bash:

 -i text Use TEXT as the initial text for Readline -e use Readline to obtain the line in an interactive shell 

So, the -i sets the default value and the -e allows you to enter another or modify it. You don't need the extra echo.

You want the -e and -i options to read:

#!/bin/sh echo "@@@@@@@@@@ @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]: @@@@@@@@@@" read -i "our-platform-7.26-2.17-res4" -e SuggestDefaultPlatform echo "you chose $SuggestDefaultPlatform" 

From help read:

 -i text Use TEXT as the initial text for Readline -e use Readline to obtain the line in an interactive shell 

So, the -i sets the default value and the -e allows you to enter another or modify it. You don't need the extra echo.

You want to use bash instead of sh and the -e and -i options of its read builtin:

#!/bin/bash - echo "@@@@@@@@@@ @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]: @@@@@@@@@@" read -i "our-platform-7.26-2.17-res4" -e SuggestDefaultPlatform echo "you chose $SuggestDefaultPlatform" 

From help read in bash:

 -i text Use TEXT as the initial text for Readline -e use Readline to obtain the line in an interactive shell 

So, the -i sets the default value and the -e allows you to enter another or modify it. You don't need the extra echo.

Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

You want the -e and -i options to read:

#!/bin/sh echo "@@@@@@@@@@ @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]: @@@@@@@@@@" read -i "our-platform-7.26-2.17-res4" -e SuggestDefaultPlatform echo "you chose $SuggestDefaultPlatform" 

From help read:

 -i text Use TEXT as the initial text for Readline -e use Readline to obtain the line in an interactive shell 

So, the -i sets the default value and the -e allows you to enter another or modify it. You don't need the extra echo.