FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 06-29-2011, 09:57 AM
amritpal pathak
 
Default Problem in making a script

hello everyone* * * * * * * * * * * * * * * * * * * * Well i dont whether i am going to ask a right question or not.I am making a script for my project.In between there is need for *settings of configuration files as per each user's needs.
For example:*users will edit the file to mention he/her own mobile number ,own moblie model ,own database etc etc.How can i do it in the script?I mean each user will do it itself or there is any way to do it automatically ?

Thanks in advance*
amritpalpathakgne.wordpress.com*
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 11:14 AM
Nils Kassube
 
Default Problem in making a script

amritpal pathak wrote:
> I am making a script for my
> project.In between there is need for settings of configuration
> files as per each user's needs. For example:
> users will edit the file to mention he/her own mobile number ,own
> moblie model ,own database etc etc.
> How can i do it in the script?

If by script you mean "bash script", you could use the echo and read
commands to query the user. And for manipulating config files you could
use e.g. sed if the config file is a text file. Please have a look at
these URLs for more details:

<http://www.gnu.org/software/bash/manual/html_node/index.html>
<http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html>
<http://tldp.org/LDP/abs/html/index.html>
<http://www.gnu.org/software/sed/manual/html_node/index.html>

If you don't mean a bash script, please clarify which script language
you are interested in.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 11:15 AM
amritpal pathak
 
Default Problem in making a script

On Wed, Jun 29, 2011 at 5:57 AM, amritpal pathak <amritpalpathak1@gmail.com> wrote:

hello everyone� � � � � � � � � � � � � � � � � � � � Well i dont whether i am going to ask a right question or not.I am making a script for my project.In between there is need for �settings of configuration files as per each user's needs.

For example:�users will edit the file to mention he/her own mobile number ,own moblie model ,own database etc etc.How can i do it in the script?I mean each user will do it itself or there is any way to do it automatically ?


well i found �i can accept user's input by using read command in scripting .but still i have another problem.��� � � � � � � � �I ��have to edit the config file i.e I want that input given by the users will be replace by config file's entries at particuler line.
please tell me how to replace user's input with config file's particuler line's stuff?


i am using gedit text editor.

Again thanks

amritpalpathakgne.wordpress.com
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 11:22 AM
amritpal pathak
 
Default Problem in making a script

On Wed, Jun 29, 2011 at 7:14 AM, Nils Kassube <kassube@gmx.net> wrote:

amritpal pathak wrote:

> I am making a script for my

> project.In between there is need for *settings of configuration

> files as per each user's needs. For example:

> *users will edit the file to mention he/her own mobile number ,own

> moblie model ,own database etc etc.

> How can i do it in the script?



If by script you mean "bash script", you could use the echo and read

commands to query the user. And for manipulating config files you could

use e.g. sed if the config file is a text file. Please have a look at

these URLs for more details:



<http://www.gnu.org/software/bash/manual/html_node/index.html>

<http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html>

<http://tldp.org/LDP/abs/html/index.html>

<http://www.gnu.org/software/sed/manual/html_node/index.html>



If you don't mean a bash script, please clarify which script language

you are interested in.



I dont know more about scripting.I just making a .sh file in gedit editor.is it bash scripting or linux shell scripting ?
Thanks you for reply

amritpalpathakgne.wordpress.com*
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 11:35 AM
amritpal pathak
 
Default Problem in making a script

On Wed, Jun 29, 2011 at 7:15 AM, amritpal pathak <amritpalpathak1@gmail.com> wrote:



On Wed, Jun 29, 2011 at 5:57 AM, amritpal pathak <amritpalpathak1@gmail.com> wrote:


hello everyone* * * * * * * * * * * * * * * * * * * * Well i dont whether i am going to ask a right question or not.I am making a script for my project.In between there is need for *settings of configuration files as per each user's needs.


For example:*users will edit the file to mention he/her own mobile number ,own moblie model ,own database etc etc.How can i do it in the script?I mean each user will do it itself or there is any way to do it automatically ?



well i found *i can accept user's input by using read command in scripting .but still i have another problem.*** * * * * * * * *I **have to edit the config file i.e I want that input given by the users will be replace by config file's entries at particuler line.(suppose at line 9)

please tell me how to replace user's input with config file's particuler line's stuff?


*please somebody tell me how to do it.I urgently need it.
*I will be greatful to him*
amritpalpathakgne.wordpress.com*

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 11:35 AM
amritpal pathak
 
Default Problem in making a script

On Wed, Jun 29, 2011 at 7:15 AM, amritpal pathak <amritpalpathak1@gmail.com> wrote:



On Wed, Jun 29, 2011 at 5:57 AM, amritpal pathak <amritpalpathak1@gmail.com> wrote:


hello everyone* * * * * * * * * * * * * * * * * * * * Well i dont whether i am going to ask a right question or not.I am making a script for my project.In between there is need for *settings of configuration files as per each user's needs.


For example:*users will edit the file to mention he/her own mobile number ,own moblie model ,own database etc etc.How can i do it in the script?I mean each user will do it itself or there is any way to do it automatically ?



well i found *i can accept user's input by using read command in scripting .but still i have another problem.*** * * * * * * * *I **have to edit the config file i.e I want that input given by the users will be replace by config file's entries at particuler line.(suppose at line 9)

please tell me how to replace user's input with config file's particuler line's stuff?


*please somebody tell me how to do it.I urgently need it.
*I will be greatful to him*
amritpalpathakgne.wordpress.com*

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 11:46 AM
Nils Kassube
 
Default Problem in making a script

amritpal pathak wrote:
> > How can i do it in the script?

> > well i found i can accept user's input by using read command in
> > scripting .but still i have another problem.
>
> I have to edit the config file i.e I want that
> input given by the users will be replace by config file's entries at
> particuler line.
> please tell me how to replace user's input with config file's
> particuler line's stuff?
>
> i am using gedit text editor.

If you want to do it with a script, gedit isn't the right tool. Use sed
instead which is made for this task. Here is once more the link to the
sed manual:

<http://www.gnu.org/software/sed/manual/html_node/index.html>

If you need further assistance, please tell us how you know which line
to replace. Is it a particular line number or a text pattern?


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 11:46 AM
Nils Kassube
 
Default Problem in making a script

amritpal pathak wrote:
> > How can i do it in the script?

> > well i found i can accept user's input by using read command in
> > scripting .but still i have another problem.
>
> I have to edit the config file i.e I want that
> input given by the users will be replace by config file's entries at
> particuler line.
> please tell me how to replace user's input with config file's
> particuler line's stuff?
>
> i am using gedit text editor.

If you want to do it with a script, gedit isn't the right tool. Use sed
instead which is made for this task. Here is once more the link to the
sed manual:

<http://www.gnu.org/software/sed/manual/html_node/index.html>

If you need further assistance, please tell us how you know which line
to replace. Is it a particular line number or a text pattern?


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 12:08 PM
amritpal pathak
 
Default Problem in making a script

On Wed, Jun 29, 2011 at 7:46 AM, Nils Kassube <kassube@gmx.net> wrote:

amritpal pathak wrote:

> > How can i do it in the script?



> > well i found *i can accept user's input by using read command in

> > scripting .but still i have another problem.

>

> * * * * * * * * *I * have to edit the config file i.e I want that

> input given by the users will be replace by config file's entries at

> particuler line.

> please tell me how to replace user's input with config file's

> particuler line's stuff?

>

> i am using gedit text editor.



If you want to do it with a script, gedit isn't the right tool. Use sed

instead which is made for this task. Here is once more the link to the

sed manual:



<http://www.gnu.org/software/sed/manual/html_node/index.html>



If you need further assistance, please tell us how you know which line

to replace. Is it a particular line number or a text pattern* * * *particuler line number.*
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-29-2011, 12:08 PM
amritpal pathak
 
Default Problem in making a script

On Wed, Jun 29, 2011 at 7:46 AM, Nils Kassube <kassube@gmx.net> wrote:

amritpal pathak wrote:

> > How can i do it in the script?



> > well i found *i can accept user's input by using read command in

> > scripting .but still i have another problem.

>

> * * * * * * * * *I * have to edit the config file i.e I want that

> input given by the users will be replace by config file's entries at

> particuler line.

> please tell me how to replace user's input with config file's

> particuler line's stuff?

>

> i am using gedit text editor.



If you want to do it with a script, gedit isn't the right tool. Use sed

instead which is made for this task. Here is once more the link to the

sed manual:



<http://www.gnu.org/software/sed/manual/html_node/index.html>



If you need further assistance, please tell us how you know which line

to replace. Is it a particular line number or a text pattern* * * *particuler line number.*
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 05:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org