Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Saturday, March 27, 2021

Print Multiplication table of any number | Unix programming | Unix Shell scripting | 27/03/2021

Print Multiplication table of any number | Unix programming | Unix Shell scripting | 27/03/2021




Algorithm :

  1. Take input from the user.
  2. assign it to a variable 'n'
  3. Declare a variable 'i'
  4. Now, apply while loop with condition ( 'i' less than equal to 10 )
  5. Start the loop by ( do )
  6. Store the result of multiplication of  'n' and 'i' in another variable 'res'
  7. Print the result
  8. Increment the variable 'i'
  9. Close the loop by ( done )

Program

echo "Enter the number : "
read n
i=1
while [ $i -le 10 ]
do
        let res=n*i
        echo " $n x $i = $res "
        let i=i+1
done

Execution on Unix terminal :


Output : 



So, this was unix shell script for displaying the table of any number.
Please feel free to ask any questions in your mind.
You may have different solution to this question, please let me know if there is any better answer, I would happy to accept that.

Thank you and Happy Learning.

Please comment if you have any doubts regarding the post. 






 

Saturday, March 20, 2021

How to practice Unix/Linux command offline without installing Virtual-box and Ubuntu | Know How | 20/03/2021

How to practice Unix/Linux command offline without installing Virtual-box and Ubuntu | Know How

Hello Buddy,

Note : Please read the complete article and follow the step for installing the software.

What are the problems faced by the user?

Are you looking for a place where you can practice Unix/Linux commands without installing virtual-box and Ubuntu.

The problem occurs because Ubuntu is a big software which occupies more than 3Gb of hard-disk and installation is complex as well.

Sometimes it happens that your system doesn't work properly after the installation of Virtual-box and Ubuntu.

Also many people don't have access to internet for using online platforms and online platforms doesn't even allows most of the commands to execute.

How I am going to solve your problem

Lets talk about a WOW factor

Here, I am going to tell you about a software whose size is about 1,320kb only.

Easy to install : - Just next >> next >>next........finish.

Software : -

CYGWIN (64 -bit recommended)

Note : 32 - bit Cygwin is non-recommended by the software itself.

Steps to download and Install :

  1. Visit https://www.cygwin.com/ 

  2. In installing Cygwin >> Press setup-x86_64.exe
  3. Open the file in the folder
  4. Right click and Run as administrator

  1. Click  ' Next > '

  2. Click  ' Next > '

  3. Click  ' Next > '

  4. Click  ' Next > '

  5. Click  ' Next > '

  6. Select ' https://cygwin.mirrors.hooby.com'

  7. Click  ' Next > ' at bottom right corner

  8. Click  ' Next > '

  9. Click  ' Next > '

  10. If in case it shows any error ->  Click  ' Retry ' , it will be automatically solve the problem.
  11. Select both the checkboxes and  Click  ' Finish '

  12. Open ' Cygwin64 Terminal ' from the shortcut created on the desktop.

Where your files are going to be created ?

  1. Open ' This PC ' 

  2. Select 'cygwin64' folder

  3. Open home


In this way, you can easily practice your Unix commands without any problem of installing a heavy software.
Just follow the simple steps!!!
Just leave a comment, in case there is a problem. 
I will try to help you as soon as possible.

Thank you!!
Happy Learning!!

Print Multiplication table of any number | Unix programming | Unix Shell scripting | 27/03/2021

Print Multiplication table of any number | Unix programming | Unix Shell scripting | 27/03/2021 Algorithm : Take input from the user. assign...