2014-02-20 2 views
-2

내 스크립트 사용자를 대화 형으로 만들고 싶습니다. 사용자가 입력으로 해당 패키지 이름을 추가 작업을해야 할 패키지 이름을 입력하면 화면에 나타납니다 스크립트 (./versionControl.sh) 제일 먼저 실행에사용자 대화 형, 쉘 스크립팅

Please enter the package name:: 

입니다

어떻게 이것을 할 수 있습니까? 추가 정보를 원하시면 여기를

echo "Enter your name, followed by [ENTER]:" 
read name 
echo $name 

확인 : 좋은 말 할 때 당신은 너무처럼 BASH read 명령을 사용하는 것이 좋습니다

+1

아무 것도 시도해 보지 않으셨습니까? –

+1

가능한 중복 [어떻게 리눅스 셸 스크립트에서 입력을 요구합니까?] (http://stackoverflow.com/questions/226703/how-do-i-prompt-for-input-in-a-linux-shell -script) – lurker

답변

0

, 이러한 몇 가지 명령은 그러면 압연 될 것입니다 :

echo "this command, echo, will output words on a screen."; 

# This pound sign is a comment, and I can use it to tell you that the read 
# command below allows you to capture input 

read someVariable; 

echo "using the dollar sign i can tell you that you entered $someVariable";