Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Bash script question for linux/ubuntu

bash script linux ubuntu

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 ccaglar

ccaglar

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 16 August 2014 - 02:09 PM

Hey Guys I need your help.Thanks in advance.

 

1) Write a bash script which reads number of directories from terminal and creates directories by using this number in their names.For example if you input 2 the script will create file_1 and file_2 directories. And how can I write to this scripts later on defining with a name ending with .sh? 

 

2) Write a bash script which reads two numbers from terminal and make the following calculation and then write the result into my_rslt file.?

 

Following calculation 3/x^2-4*y^2


Edited by ccaglar, 16 August 2014 - 02:09 PM.


#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 16 August 2014 - 02:39 PM

welcome aboard!

 

For directory creation use mkdir, as for the calculation use the bc. About the later one, here's a Codecall tutorial on how to use it.