Find the answer to your Linux question:
Results 1 to 4 of 4
I want to make some sort of file to automate several processes into one instruction for some1 to type Is there a way to do this, and can i see ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Feb 2004
    Location
    UK
    Posts
    131

    Automatic script


    I want to make some sort of file to automate several processes into one instruction for some1 to type

    Is there a way to do this, and can i see a very small and simple example of what it should look like

    Thanks

  2. #2
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    You could create a BASh script which executes a bunch of commands, and then put this file in /bin so everyone can execute it, or if for specific people, put it in their /home/username/bin.
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  3. #3
    Linux Newbie
    Join Date
    Feb 2004
    Location
    UK
    Posts
    131
    would i just list the instructions out as i would type them into the bash shell??

  4. #4
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    Open up a text editor of your choice, and then:
    #!/bin/bash

    command one

    command two
    Write these commands as you would in bash, e.g. to mount two drives it could be:
    #!/bin/bash

    mount /dev/hda2 /mnt/happy

    mount /dev/sda6 /mnt/unhappy
    then make the file execuatable with
    Code:
    chmod +x filename
    and you should be able to add that to your /bin file, you might have to specify the PATH if you want to put it in a perticular place that is not /bin.
    For more infod check out www.linuxcommand.org and http://www.linuxcommand.org/wss0010.php

    I hope this helps;

    dylunio
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •