0

I am new to Shell scripting.

Can anyone tell me what should I do in the script below, so that instead of taking the date/time as a parameter for git commit, it actually prompts me to enter the comment ?

#!/bin/bash

TODAY=$(date)
.............
.............
git commit -m "$TODAY"
............
............
3
  • 1
    man bash and search for read. Commented Sep 15, 2013 at 13:49
  • 1
    Thanks for teaching to fish :) Commented Sep 15, 2013 at 13:52
  • @KingsIndian or simply help read. Commented Sep 15, 2013 at 15:09

2 Answers 2

5
read -p "Comment: " comment
git commit -m "$comment"
Sign up to request clarification or add additional context in comments.

Comments

2
#!/bin/bash
echo "Type the date, followed by [ENTER]:"

read TODAY
git commit -m "$TODAY"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.