Files
VPS-scripts_Readme/Sed.md
2019-09-19 03:16:35 +02:00

49 lines
1.0 KiB
Markdown

# Standard SED replacements
### DOMAINname: should be replaced with $domain
Example:
```
sed -i 's/DOMAINname/'$domain'/' <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>
```