Files
VPS-scripts_Readme/Sed.md
Bram Prieshof 4bca0bf4af Added sitename
2020-07-17 13:07:28 +02:00

1.1 KiB

Standard SED replacements

DOMAINname: should be replaced with $domain

Example:

sed -i 's/DOMAINname/'$domain'/' <path/to/filename>

SITEname: should be replaced with $sitename

Example:

sed -i 's/SITEname/'$sitename'/' <path/to/filename>

PHPver: should be replaced with $phpver

Example:

sed -i 's/PHPver/'$phpver'/' <path/to/filename>

PASSword: should be replaced with $PASSword

Example:

sed -i 's/PASSword/'$PASSword'/' <path/to/filename>

DBName: should be replaced with $db_name

Example:

sed -i 's/DBName/'$db_name'/' <path/to/filename>

DBUser: should be replaced with $db_user

Example:

sed -i 's/DBUser/'$db_user'/' <path/to/filename>

DBPass: should be replaced with $db_pass

Example:

sed -i 's/DBPass/'$db_pass'/' <path/to/filename>

Replacing multiple variables within the same file:

The -e option is stackable, you can add as many as you want within a single file. Example

sed -i -e 's/DBPass/'$db_pass'/' -e 's/DBUser/'$db_user'/' <path/to/filename>

or:

sed -i -e 's/DBName/'$db_name'/' -e 's/DBUser/'$db_user'/' -e 's/DBPass/'$db_pass'/' <path/to/filename>