Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: shellscripting

  1. #1
    Join Date
    Nov 2010
    Location
    Kerala
    Beans
    376
    Distro
    Ubuntu

    shellscripting

    hi friends

    I am new in shell scripting ,I wish to know something from your knowledge ..

    I wish to add this below commands in sudo gedit /etc/mysql/my.cnf file [Under the Basic settings section, ]
    # UTF-8 Defaults for Koha
    init-connect='SET NAMES utf8'
    character-set-server=utf8
    collation-server=utf8_general_ci

    how can I do it ? is it possible to do so ?

    Thanks



    you can learn what is computer ubuntu is the best way .I start learning ubuntu in 2-1-2010 .start with UBUNTU 9 now using 12.04

  2. #2
    Join Date
    Jan 2010
    Location
    Kolkata India
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: shellscripting

    If it is a one time activity you might not need to scriptize it .

    Code:
    echo -e "init-connect='SET NAMES utf8'\ncharacter-set-server=utf8 \ncollation-server=utf8_general_ci" | sudo tee -a /etc/mysql/my.cnf
    The above commanline will append the configuration entries to the mentioned mysql conf file .Before making changes to the file dont forget to get a back up .

    Code:
    sudo cp  /etc/mysql/my.cnf  /etc/mysql/my.cnf_orig
    “Progress is made by lazy men looking for easier ways to do things”
    — Robert A. Heinlein

  3. #3
    Join Date
    Nov 2010
    Location
    Kerala
    Beans
    376
    Distro
    Ubuntu

    Re: shellscripting

    Quote Originally Posted by codemaniac View Post
    If it is a one time activity you might not need to scriptize it .

    Code:
    echo -e "init-connect='SET NAMES utf8'\ncharacter-set-server=utf8 \ncollation-server=utf8_general_ci" | sudo tee -a /etc/mysql/my.cnf
    The above commanline will append the configuration entries to the mentioned mysql conf file .Before making changes to the file dont forget to get a back up .

    Code:
    sudo cp  /etc/mysql/my.cnf  /etc/mysql/my.cnf_orig
    there is a basic setting line in the my.cnf file I need to add this under this one ,is this do so ?is it possible ?

    And I have one question remain ,is it possible execute password using ssh while we create script ?
    this is the example
    ssh koha@ip
    password
    scp -r koha@ip:~/backup ~/Desktop
    password
    you can learn what is computer ubuntu is the best way .I start learning ubuntu in 2-1-2010 .start with UBUNTU 9 now using 12.04

  4. #4
    Join Date
    Jan 2010
    Location
    Kolkata India
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: shellscripting

    Quote Originally Posted by Rakeshvijayan View Post
    there is a basic setting line in the my.cnf file I need to add this under this one ,is this do so ?is it possible ?

    And I have one question remain ,is it possible execute password using ssh while we create script ?
    this is the example
    ssh koha@ip
    password
    scp -r koha@ip:~/backup ~/Desktop
    password
    Any type of text file manipulation is possible through native Unix utilities .Please post your exact requirement .

    In order to do a passwordless ssh , you need to set up public ket authentication .Please follow the below guide .

    https://help.ubuntu.com/community/SSH/OpenSSH/Keys
    “Progress is made by lazy men looking for easier ways to do things”
    — Robert A. Heinlein

  5. #5
    Join Date
    Nov 2010
    Location
    Kerala
    Beans
    376
    Distro
    Ubuntu

    Re: shellscripting

    Quote Originally Posted by codemaniac View Post
    Any type of text file manipulation is possible through native Unix utilities .Please post your exact requirement .

    In order to do a passwordless ssh , you need to set up public ket authentication .Please follow the below guide .

    https://help.ubuntu.com/community/SSH/OpenSSH/Keys

    I had already read this one , my question is, is it possible to give password in the script ,is it possible to do that ..... thanks for the help
    you can learn what is computer ubuntu is the best way .I start learning ubuntu in 2-1-2010 .start with UBUNTU 9 now using 12.04

  6. #6
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: shellscripting

    Quote Originally Posted by Rakeshvijayan View Post
    I had already read this one , my question is, is it possible to give password in the script ,is it possible to do that ..... thanks for the help
    Use the application "expect"

    http://www.linuxjournal.com/article/3065
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #7
    Join Date
    Nov 2010
    Location
    Kerala
    Beans
    376
    Distro
    Ubuntu

    Re: shellscripting

    Quote Originally Posted by bodhi.zazen View Post
    Use the application "expect"

    http://www.linuxjournal.com/article/3065
    look friend I am new here in shell scripting this is new idea for me ,by learn this it take more time to learn . need an scripting skills of any one ,
    my question is how to provide password through the script for the ssh service
    This is mostly frequent for me

    Thanks
    you can learn what is computer ubuntu is the best way .I start learning ubuntu in 2-1-2010 .start with UBUNTU 9 now using 12.04

  8. #8
    Join Date
    Nov 2008
    Location
    Lleida, Spain
    Beans
    1,157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: shellscripting

    Quote Originally Posted by Rakeshvijayan View Post
    look friend I am new here in shell scripting this is new idea for me ,by learn this it take more time to learn . need an scripting skills of any one ,
    my question is how to provide password through the script for the ssh service
    This is mostly frequent for me

    Thanks
    As said before, use expect to send your credentials. expects interacts as a real user. Read the expect docuemntation and you will be able to make what you want.

    Expect examples:
    http://www.thegeekstuff.com/2010/10/expect-examples/

  9. #9
    Join Date
    Jan 2010
    Location
    Kolkata India
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: shellscripting

    Quote Originally Posted by Rakeshvijayan View Post
    I had already read this one , my question is, is it possible to give password in the script ,is it possible to do that ..... thanks for the help
    Passwords were never meant to be provided in some configuration files for some scripts/programs to be read and get executed .This will deny the 35 years of Unix security .
    “Progress is made by lazy men looking for easier ways to do things”
    — Robert A. Heinlein

  10. #10
    Join Date
    Nov 2010
    Location
    Kerala
    Beans
    376
    Distro
    Ubuntu

    Re: shellscripting

    Quote Originally Posted by codemaniac View Post
    Passwords were never meant to be provided in some configuration files for some scripts/programs to be read and get executed .This will deny the 35 years of Unix security .
    Thanks for the valuable information , I want to learn this one I am trying give it on my small network only for learning .need more help from you all this thread may never close because I need more information from you all
    you can learn what is computer ubuntu is the best way .I start learning ubuntu in 2-1-2010 .start with UBUNTU 9 now using 12.04

Page 1 of 2 12 LastLast

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
  •