Loop over lines in shell pipeline
To loop over a list of line do this:
|
1 |
ls -al | while IFS= read -r line ; do echo $line; done |
To loop over a list of line do this:
|
1 |
ls -al | while IFS= read -r line ; do echo $line; done |
TR can be used to convert a list of items from one per line to space separated with this:
|
1 |
tr '\r\n' ' ' |
Recently needed a good way to fetch the IP address of each interface within a script. Tried things like:
|
1 |
ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' |
and
|
1 |
/sbin/ifconfig | sed -n '2 p' | awk '{print $3}' |
But this is fairly ugly. So I tried:
|
1 |
hostname -I |
This gives a list of IP addresses but they
Applying the new SUPEE-7405 patch to Magento 1.7.0.2 (and probably other versions) results in a parse error in the sales order view page (admin/sales_order/view/order_id) if the site is running under PHP5.3. Here’s the error message:
|
1 2 |
PHP message: PHP Parse error: syntax error, unexpected '[' in /app/code/core/Mage/Adminhtml/Helper/Sales.php on line 124 |
The offending line is:
|
1 |
$links = []; |
it
Recent on servers with Plesk 12 and the PHP 5.3 distribution from Odin, we’re seeing “abrt” crash reports from Yum with a back trace like:
|
1 2 |
:miscutils.py:71:checkSig:OSError: [Errno 2] No such file or directory: '/var/cache/yum/x86_64/7/plesk-php-5.3/packages/plesk-php53-ioncube-loader-5.0.18-centos7.15101218.x86_64.rpm' |
Until Odin fixes their repository the only way to get updates to proceed normally
Reliable Penguin provides managed web hosting, systems administration, website and server migrations, and expert consulting.
Submit the form—or for immediate service call 866-649-7984.