CrazyEngineers
  • Shell script in linux

    Updated: Oct 25, 2024
    Views: 1.2K
    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.😀
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Abhishek Rawal

    MemberAug 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.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register