sed '/pattern/{p;s/pattern/replacement/}' input_file
Explanation:
/pattern/
: This specifies the pattern that identifies the line you want to duplicate and modify.{p;s/pattern/replacement/}
: This is a group of commands enclosed within {}.
// ext_tables.sql | |
CREATE TABLE tx_xxxxxxx_domain_model_record ( | |
... | |
type int(11) unsigned DEFAULT '0', | |
... | |
); | |
// TCA | |
'type' => [ | |
'exclude' => false, |
renderables: | |
- | |
type: Page | |
identifier: page | |
label: Form | |
renderables: | |
- | |
defaultValue: '' | |
type: Text | |
identifier: name |
/* This modifies the outer part of the CKeditor */ | |
.cke_combo__styles .cke_combo_text { width: 150px; } | |
.cke_combo__format .cke_combo_text { width: 150px; } | |
.cke_combopanel { width: 150px !important; } |
TYPO3: | |
CMS: | |
Form: | |
prototypes: | |
standard: | |
formElementsDefinition: | |
Form: | |
renderingOptions: | |
translation: | |
translationFiles: |
#!/bin/bash | |
URLS=( | |
https://www.example.net/ | |
https://www.example.com/ | |
) | |
DEPTH=5 | |
ALLOWED_DOMAINS=www.example.net,www.example.com | |
EXCLUDE=typo3conf,fileadmin,typo3temp,uploads |
<?php | |
$tt = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TimeTracker\TimeTracker::class); | |
$tt->start(); | |
// Expensive operation here | |
$tt->finish(); | |
// Print the runtime between start and finish in milliseconds. |
<?php | |
namespace My\Extension\Hooks; | |
use TYPO3\CMS\Backend\Controller\PageLayoutController; | |
use TYPO3\CMS\Backend\View\BackendLayoutView; | |
use TYPO3\CMS\Core\Utility\GeneralUtility; | |
class PageModuleHook | |
{ |
Berechnung und Zuweisung zu neuer Variable: | |
✗ {imageWidth / 2.24 -> f:variable(name: 'imageHeight')} | |
✓ {f:variable(name:'imageHeight', value:'{imageWidth / 2.71}')} | |
Casting | |
✗ {imageHeight as integer -> f:variable(name:'imageHeight')} | |
✓ {f:variable(name:'imageHeight',value:'{imageHeight as integer}')} |
t3version() { | |
[[ -z "$1" ]] && echo "Specify new version parameter!" && return | |
extEmconf=$(git ls-files *ext_emconf.php) | |
if [ ! -z "$extEmconf" ]; then | |
sed -i "s/'version'\(\s*\)=>\(\s*\)'\(.*\)',/'version'\1=>\2'$1',/" $extEmconf | |
git add $extEmconf | |
echo "Updated version in all ext_emconf.php's" | |
fi | |
packageJson=$(git ls-files *package.json) | |
if [ ! -z "$packageJson" ]; then |