Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Setting config database user and password using sed Post 303035074 by dco on Monday 13th of May 2019 05:49:05 PM
Old 05-13-2019
Hello,
many thanks for your reply.

@Neo, Unfortunately I can't use this command:

Code:
 sed -i.bak  's/oldpass/newpass/g'

Because I have several settings with the same string ... Smilie

Example:
Code:
define("__DATABASE_USER__",              "oldpass");
define("__DATABASE_PASSWORD__",              "oldpass");

I would like to change only the DATABASE_PASSWORD and do not change the string for DATABASE_USER.

I try to change the following bloc using sed substitution: define("__DATABASE_USER__", "oldpass");

@nezabudka, thank you for your help but your command line do not replace

Code:
define("__DATABASE_PASSWORD__",              "oldpass");

by

Code:
define("__DATABASE_PASSWORD__",              "newpass");

Code:
shell command: sed 's/\(define("__DATABASE_PASSWORD__",\s*"\)\([^"]\+\)/\1newpass/g' config.php

output:
Code:
define("__DATABASE_USER__",              "oldpass");
define("__DATABASE_PASSWORD__",              "oldpass");

Good evening.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

I can't fire up MySql on my Fedora Server - Obvious config setting?

Hiya All, I can't fire up MySql on my FC-3 Server at work. I get the Error message at the end of this post. Looks like some Config problem on the Server itself. (Ie web server and MYSQL is all on the same box. I get the same errror when trying to fire up MYSQL at the Box, as well as... (2 Replies)
Discussion started by: marty 600
2 Replies

2. UNIX for Advanced & Expert Users

UX Kernel setting while database installation

Hi All I am kinda wondering about the UX kernel parameters, how we configure and why do we configure ???.. especially the 'semaphores'. Could somebody throw some light on this and would really appreciate it. (1 Reply)
Discussion started by: Prince_Charming
1 Replies

3. UNIX for Advanced & Expert Users

setting password for user using useradd?

hi all i am writing a script to create user and group from the input given to script for eg. script needs to values 1. mode - 1 or 2 2. id - if mode is 1 then id should be 2 char like x1 / v1 / v2 if mode is 2 then id should be 1 char like x / v / e from these to values group is... (1 Reply)
Discussion started by: zedex
1 Replies

4. Solaris

Password Setting

Hi: Could I set the: - Login Time-out Interval - Password History Count - Lockout Duration - Lockout Threshold for user account in Sun Solaris 5.8. Thanks for your help (6 Replies)
Discussion started by: mlsun
6 Replies

5. UNIX for Dummies Questions & Answers

Firefox: Setting about:config options upon install

Is there a way to set the about:config options for Firefox automatically as part of the installation of Firefox? (3 Replies)
Discussion started by: figaro
3 Replies

6. UNIX for Advanced & Expert Users

Can we Automate the User creation and setting password through a script in solaris 10

Hi, I am using Solaris 10 OS and Bash shell.Is there any way can we automate User creation and setting passwords through a script or any freeware tool. Advance thanks for your response. (1 Reply)
Discussion started by: muraliinfy04
1 Replies

7. Solaris

Is there a difference between setting a user as nologin and setting it as a role?

Trying to figure out the best method of security for oracle user accounts. In Solaris 10 they are set as regular users but have nologin set forcing the dev's to login as themselves and then su to the oracle users. In Solaris11 we have the option of making it a role because RBAC is enabled but... (1 Reply)
Discussion started by: os2mac
1 Replies

8. Shell Programming and Scripting

Setting up postgreSql database

Hi I have a small bash script which I want to run on an Amazon EC2 Ubuntu instance for setting up a postgreSQL database: #!/bin/bash USERNAME='postgres' start=$SECONDS TMP_DIR=/local/test/4g4d PORT=23456 rm -rf $TMP_DIR/db mkdir -p $TMP_DIR/ echo "creating database..."... (3 Replies)
Discussion started by: Helveticus
3 Replies

9. Shell Programming and Scripting

DB Password encryption in config file

Hi Gurus, I need to encrypt the Db passwords which are stored in a configuration file (.txt) as below: stage_db_pwd=ABC this is test line content_db_pwd=123def This is test line 2 stg_db_name=xyz I want to encrypt all the password fields (identified by "pwd"), encrypt them in the same... (3 Replies)
Discussion started by: ashishpanchal85
3 Replies
Locale::Codes::LangFam(3)				User Contributed Perl Documentation				 Locale::Codes::LangFam(3)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-02-27 Locale::Codes::LangFam(3)
All times are GMT -4. The time now is 09:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy