Author Topic: How to create an sh shell script that executes commands?  (Read 758 times)

0 Members and 1 Guest are viewing this topic.

Offline evgenipirianov

  • Jr. Member
  • **
  • Posts: 1
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
How to create an sh shell script that executes commands?
« on: June 18, 2018, 11:04:23 am »


Since I am quite new to sh and Linux shell scripting, I would like to ask you for some help. I now run the following 4 commands in separate terminals:

tendermint init (1) sudo mongod (2) bigchaindb start (3) tendermint node (4)

so I can get my thing started and working. In future, I would like to use 1 single sh script that I can start which will on his turn start each of the 4 commands either in the background (nohuo) or in separate terminals. I tried doing the last using the command screen but did not get it to work somehow. YOu can also see that I will need to hardcode somehow my sudo user when I call the mongod.

Could you suggest how to put the 4 lines in a .sh file that I can quitely exectute ?

Thanks!

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17663
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: How to create an sh shell script that executes commands?
« Reply #1 on: June 18, 2018, 11:53:40 am »
Which distro ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal