-3

I am looking for some basic script that I can fine tune.

Basically I am looking for a script that does this:

./greeting.sh

:Enter Greeting

User input "good morning"

Script:

Echo "hello $UserInput"

Output:

Hello "good morning"
5
  • This is on a Ubuntu 14.04 x64 Server, I am assuming I will be using She-Bang to start script #!/bin/bash Dec 9, 2015 at 8:39
  • Please spend 5 minutes reading a basic bash tutorial before asking here. While we do accept simple and basic questions, we also expect users to put some effort into their question. Any tutorial at all would have shown you how to do this.
    – terdon
    Dec 9, 2015 at 9:17
  • I am horrible at scripting, reading a 5 minute bash tutorial would not help me, as I have taken Linux/Java/PHP classes and still can't make a script. I can however edit code and understand it. Can I not ask for help where I need it and give it where I am good at it? Dec 15, 2015 at 5:16
  • Sure, but that doesn't change the fact that we expect users to put in at least the minimum amount of effort into trying something themselves before asking. Just about any search would have given you this answer. Fr example: bash read user input.
    – terdon
    Dec 15, 2015 at 12:22
  • I understand, but it was the simplicity I could not find. All those guides have huge code blocks, the code below is perfect as it is very very small amount of code. I will search for beginner help somewhere else if it is going to hurt my rep like this question did. (Does taking Java, PHP, and Linux courses not count as minimum amount of effort?).. Either Way I get your point and I'll stop arguing. Dec 15, 2015 at 19:18

1 Answer 1

2
#!/bin/bash

echo ":Enter Greeting"
read input
echo "Hello \"$input\""

It is that right do you want it?

1
  • Thanks for taking the time, it is the "shortness" of your code I could not find! Everywhere else has big if/then statements or while/then/true statements etc etc. Dec 15, 2015 at 19:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .