Results 1 to 2 of 2

Thread: run long string using short-name script

  1. #1
    Join Date
    Jan 2013
    Beans
    62

    Question run long string using short-name script

    Hi all,

    my need is to run long string

    # program -parameter1 -parameter2 ... -parameterN

    using short-name script.

    I'm new to writing scripts, how do I start?

  2. #2
    Join Date
    Aug 2011
    Location
    52° N 6° E
    Beans
    1,876
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: run long string using short-name script

    If the parameters are fixed you can use an alias.

    Open the file .bashrc in a text editor. It's in your home directory, but it's hidden. Check wether the lines
    Code:
    if [ -f ~/.bash_aliases ]; then
        . ~/.bash_aliases
    fi
    are present. If they are, then close the file and open .bash_aliases in your text editor. If they are not, you can add them and open .bash_aliases, or input the following line directly in .bashrc.

    Next put in your .bash_aliases the line
    Code:
    alias shortname='program -parameter1 -parameter2 ... -parameterN'
    Close your terminal and open a new one and your alias should work.

Tags for this Thread

Bookmarks

Posting Permissions

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