Search Results

Search: Posts Made By: MR.bean
1,205
Posted By MR.bean
$ perl -lne 'if(/create/ .. /Elapsed/) {...
$ perl -lne 'if(/create/ .. /Elapsed/) { if(/create\s+index\s+(.*)\s+on/) { $i = $1 } elsif(/^Elapsed:\s+(.*)$/) { $e = $1; print join("\t", $i, $e); } }' input
XYZ_F75 00:08:08.58
XYZ_F81...
2,108
Posted By MR.bean
Assuming you have this input and you want the...
Assuming you have this input and you want the following output


$ cat xyz
primary
Factory CTS 1.9.0(46) P1
*Slot 1 CTS 1.10.2(42) P1
primary
Factory CTS 2.0.0(18) P1
*Slot 1 CTS 2.1.0(42)...
1,859
Posted By MR.bean
Make sure you have installed the Date::Calc...
Make sure you have installed the Date::Calc Module


perl -MDate::Calc -e 'use Date::Calc qw(Delta_DHMS); ($Dd,$Dh,$Dm,$Ds) = Delta_DHMS($year1,$month1,$day1, $hour1,$min1,$sec1,...
3,342
Posted By MR.bean
bash-3.2$ cat input.txt ^[[7m PID USER PR...
bash-3.2$ cat input.txt
^[[7m PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND ^[[m^O^[[K...
2,019
Posted By MR.bean
The following does what you want du -ab . |...
The following does what you want
du -ab . | sort -nr | grep -i '.tar.gz$'
1,226
Posted By MR.bean
Like that? bash-3.2$ awk 'BEGIN{x=1}...
Like that?


bash-3.2$ awk 'BEGIN{x=1} /DEFINE SCHEMA/,/\)\;/ {if (NF==2) { $1="t"x" as filler"; print; x++ }}' filename
t1 as filler VARCHAR(10)
17,685
Posted By MR.bean
echo abc.tpt.ctl | rev | cut -c 9- | rev abc ...
echo abc.tpt.ctl | rev | cut -c 9- | rev
abc

bash-3.2$ cat x
abc.tpt.ctl
bdc.tpt.ctl
cdw.tpt.ctl
bash-3.2$ cat x | rev | cut -c 9- | rev
abc
bdc
cdw
2,281
Posted By MR.bean
Try this filecount=$(find . -type f...
Try this


filecount=$(find . -type f -name "*.csv" | wc -l)
1,818
Posted By MR.bean
Try: java ./java_programs/test_program/test ...
Try: java ./java_programs/test_program/test

without the .java extension like you had
8,477
Posted By MR.bean
bash-3.2$ cat txt ...
bash-3.2$ cat txt
source,cu_001,cu_001_volume,cu_001_mass,cu_002,cu_002_volume,cu_002_mass,cu_003,cu_003_volume,cu_003_mass
ja116,1.33,3024000,9374400,1.54,3026200,9375123,1.98,3028000,9385512
...
Forum: Red Hat 07-22-2013
2,802
Posted By MR.bean
you have to power off the vm to run the backup by...
you have to power off the vm to run the backup by mounting their file systems or dd them out unless you have backup agents running in your vm
2,717
Posted By MR.bean
Hopefully someone could explain it better than me...
Hopefully someone could explain it better than me :D



my $c=0; # set counter to 0
my %r=(); # initialize hash %r

while(<>) {
# if line matches: 'MOBILITY EVENT...
1,419
Posted By MR.bean
awk -F: '$3 ~ /^20/ {print $0}' input_file
awk -F: '$3 ~ /^20/ {print $0}' input_file
3,196
Posted By MR.bean
yeah, "last" is just breaking the loop. In bash,...
yeah, "last" is just breaking the loop. In bash, use break


#!/bin/bash

while read line
do
if [[ "${line}" =~ "^CREATE TABLE" ]]
then
# add code to begin...
3,196
Posted By MR.bean
Okay, I've coded a perl version similar to your...
Okay, I've coded a perl version similar to your java version after looking at your code more precisely. I am leaving that file operation aside first.


#!/usr/bin/perl

while(<>) {
...
3,196
Posted By MR.bean
perl -lne '/^\s*CREATE\s+TABLE/i && open FILE,...
perl -lne '/^\s*CREATE\s+TABLE/i && open FILE, ">tmpfile.sql"; (/^\s*CREATE\s+TABLE/i .. /^\s*\)\s+ENGINE=InnoDB/i) && print FILE; /^\s*\)\s+ENGINE\InnoDB/i && close FILE;' mysqldump.sql


That...
Showing results 1 to 16 of 16

 
All times are GMT -4. The time now is 04:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy