Shell script in linux

NITISH CSE JHS

NITISH CSE JHS

@nitish-cse-jhs-taOxlU Oct 25, 2024
hi,
please tell me commands in linux that shows u how to create shell scripts in linux enter data and save and how to view the data and how to append the data and shortcuts in shell scripting.😀

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Aug 22, 2012

    Use vim or gedit or any editor to write shell script

    syntax is : chmod permission your-script-name

    for eg:
    $ chmod +x your-scipt-name
    $ chmod 755 your-script-name [will Read-write & execute for owner(7), while for group & other permission is read & execute(5)]

    Executing the script:
    $ bash bar(your-script-name)
    $ sh bar(your-script-name)
    $ ./bar(your-script-name)

    . command-name
    for example
    $ .trollhard

    Now try shell scripting
    Open Gedit or Vim
    type;

    $ vi first
    #
    #My first shell script
    #
    clear
    echo "Trolls are cute"
    Save the script & run using below command using "Executing the script" commands given above.