Tuesday 21 June 2016

how to create and run shell script in linux

It is the easiest and funniest task how to create and run shell script in linux.
It gives lots of handful tools to us.





The shell script file can be transferred from one computer to another very easily.
By using it, we can store our code upto the time we want.

how to create and run shell script in linux

Let's start with an example

      create shell file to display all text files on Desktop.
      Open any text editor say, leafpad then write the code.
      Code is:
    • for  i  in  *.txt
    • do
    • echo  $i
    • done
    After it, save the file and give it any name with extension .sh Example:  anyname.sh
    and save it to any directory.

how to create and run shell script in linux

Now it's the time to run the file
  • Open up the terminal,and write command
  • root@kali:~#   cd  /Desktop
  • root@kali:~/Desktop#   chmod  u=x  shell_script.sh
    It gives permission to the shell script to be executable by users.
  • root@kali:~/Desktop#   ./shell_script
    ./  is used before the name of shell script to run it
  • Mine output is :  iaminfinity.txt
    iaminnovator.txt
    iammoneymagnate.txt
    iamtheking.txt
    iamtheleader.txt



Hence, to create and run shell script in linux
  • create the file with extension .sh
  • then give the file permission to get executed by the user
    chmod   u=x  any_file.sh
  • then run the file by   ./any_file.sh

6 comments:

  1. If you think your spouse may be cheating, you can contact PHONESPYAPPS1@GMAIL.COM
    He’s a real hacker and was very reliable in helping me spy on my cheating husband’s cell phone remotely.

    ReplyDelete
  2. I was diagnose with human papilloma virus (HPV) 4 years ago and i met a doctor he told me there is no cure and i have be taking some medication the warts multiplied when trying to removed them and it got me embarrass and pains, luckily few weeks ago i was recommend to Dr Onokun for natural treatment after one week i got 100% cure and all the wart and pains got disappeared, i sheared this post because its part of my life experience, encase anyone need speedy help about this cure email Dr Onokun via, dronokunherbalcure@gmail.com

    ReplyDelete
  3. I got my already programmed and blanked ATM card to withdraw the maximum of $5,500 daily for a maximum of 6 years. I am so happy about this because i got mine last week and I have used it to get more then $350,000 and ready to pay more. United Hackers is giving out the card just to help the poor and needy though it is illegal but it is something nice is not like other scam pretending to have the blank ATM cards. And no one gets caught when using the card.
    WhatsApp: +351 965 761 372
    Email : unitedblankatmhackcard@gmail.com

    ReplyDelete

  4. Are you interested in the service of a hacker to get into a phone, facebook account, snapchat, Instagram, yahoo, Whatsapp, get verified on any social network account, increase your followers by any amount, bank wire and bank transfer. Contact him on hackintechnology@gmail.com +12132951376(WHATSAPP)

    ReplyDelete
  5. Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com

    ReplyDelete
  6. Selling USA FRESH SSN Leads/Fullz, along with Driving License/ID Number with good connectivity.

    **PRICE FOR ONE LEAD/FULLZ 2$**

    All SSN's are Tested & Verified. Fresh spammed data.

    **DETAILS IN LEADS/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL
    ->EMPLOYEE DETAILS

    ->Bulk order negotiable
    ->Minimum buy 25 to 30 leads/fullz
    ->Hope for the long term business
    ->You can asked for specific states too

    **Contact 24/7**

    Whatsapp > +923172721122

    Email > leads.sellers1212@gmail.com

    Telegram > @leadsupplier

    ICQ > 752822040

    ReplyDelete