Print String in Shell Script or Bash Program

 



Hello World in Shell/Bash
echo "Hello World"


  • Input

read str (Here read is use for taking any type of input in Bash/Shell) (str is variable name)

  • Output

echo $str  (Here echo is use for display any data and $ is use for represent a value of variable)


  • Example Code

#!/bin/bash
echo "Enter your Name"
read str
echo "Hello $str"


  • Explanation:

Input : Ritik

Output : Hello Ritik



Note:

This Code is Verified by all Test Cases.If any error occurs then Comment correct code Below in comment box.

Disclaimer:-

The above hole solution is generated by the CodexRitik . if any of the query regarding this post or website fill the following contact form Thank You.

Print String in Shell Script or Bash Program Print String in Shell Script or Bash Program Reviewed by CodexRitik on November 15, 2020 Rating: 5

No comments:

Powered by Blogger.