I found a nice tips to create a prompt for user confirmation using Bash. Its pretty simple and neat. Here is the example to create a user confirmation (y/n) on Bash: [codesyntax lang=”bash” lines=”normal” lines_start=”0″]
read -p "Continue (y/n)?" answer
case "$answer" in
* ) echo "invalid";;
[/codesyntax] When user press… Continue Reading
We can easily create our own script containing an update command. This script will attempt to update Ubuntu based system, in this case I am using Pinguy OS 14.04. Its a pretty simple script. This script was build using bash/shell… Continue Reading
After learning how to read user input on Bash programming, now its time to learn a simple If and else fi. Example [codesyntax lang=”bash” lines=”normal” lines_start=”0″ container=”pre”]
#Learn if else
echo "Type your name, please"
if [ "$name" == "fitri" ];
then echo "true"
[/codesyntax] The example above will ask for your name. If you type… Continue Reading
First of all, this is not a tutorial. This is my note on my Bash programming leraning. Its better to write any of my progress on learning this Bash on this blog. :) Read User Input: #!/bin/bash #Read user input… Continue Reading