Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: bartus11
14,380
Posted By bartus11
awk -F, 'NR==1{print "file_name",$0;next}{print...
awk -F, 'NR==1{print "file_name",$0;next}{print FILENAME , $0}' infile
1,969
Posted By bartus11
You have to escape the double quotes that you...
You have to escape the double quotes that you want to preserve in echo output, like this:echo "user_pref(\"network.proxy.http\", \"$j\");"
6,511
Posted By bartus11
I know its Perl, and it looks ugly, but if you...
I know its Perl, and it looks ugly, but if you don't mind that then here it goes:perl -pe 's/(.{105}).(.{50}).(.{79}).(.*)/\1xxx\2xxx\3xxx\4/' file > out.file I hope I didn't mess numbering ;)
1,092
Posted By bartus11
You dont need cat here. Also, use double quotes: ...
You dont need cat here. Also, use double quotes:
Search_String=100
Replace_String=151
sed "s|${Search_String}|${Replace_String}|g" ${work}/temp_${CSV_File} > $work/${work_1}/${CSV_File}
Forum: Solaris 02-08-2015
2,159
Posted By bartus11
Take a look at newtask. ...
Take a look at newtask.
(http://docs.oracle.com/cd/E26502_01/html/E29030/newtask-1.html)
Forum: Solaris 02-01-2015
9,365
Posted By bartus11
If adding more disks is possible, then you could...
If adding more disks is possible, then you could create mirrored vdevs, by attaching mirror disks to c3t5000CCA012B3E751d0 and c3t5000CCA012B39541d0. See manual for zpool attach command.
1,248
Posted By bartus11
Try:echo "Enter INPUT:" read INPUT echo...
Try:echo "Enter INPUT:"
read INPUT
echo "Enter OUTPUT:"
read OUTPUT
cut -f1-4 $INPUT | sed 's/hello/goodbye/g' | sort -uV > $OUTPUT
1,286
Posted By bartus11
Take a look here: perlform - perldoc.perl.org...
Take a look here:
perlform - perldoc.perl.org (http://perldoc.perl.org/perlform.html)
3,004
Posted By bartus11
You can also do something like this: ...
You can also do something like this:
#!/usr/bin/perl

use strict;
use warnings;
use diagnostics;

qx'sed -i "s/Hi Mom!\|Hi Dad!/Bye Everyone!/I" ./test.txt';

No more double backslash, but...
3,004
Posted By bartus11
Try:#!/usr/bin/perl use strict; use...
Try:#!/usr/bin/perl

use strict;
use warnings;
use diagnostics;

`sed -i 's/Hi Mom!\\|Hi Dad!/Bye Everyone!/I' ./test.txt`;
1,270
Posted By bartus11
Try:#!/bin/bash func_1(){ echo $1 } ...
Try:#!/bin/bash
func_1(){
echo $1
}

func_1 $1
1,707
Posted By bartus11
Try:$ORACLE_HOME/OPatch/opatch lsinventory...
Try:$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed | perl -p0e '$spaces=" " x 52;s/\n$spaces(\w)/ $1/g'
2,279
Posted By bartus11
Try:awk '{a[$1" "$2]+=$3}END{for (i in a) print...
Try:awk '{a[$1" "$2]+=$3}END{for (i in a) print i,a[i]}' file | sort
1,863
Posted By bartus11
Try:awk 'NR==FNR{a[$1]=$0}NR!=FNR{for...
Try:awk 'NR==FNR{a[$1]=$0}NR!=FNR{for (i=2;i<=NF;i++) a[$1]=a[$1]" "$i}END{for (i in a) print a[i]}' File01 File02 File03 | sed 's/\([^ ]\) /\1, /g' | sort
1,984
Posted By bartus11
Change:mkMapEntry () { test -f $6 || { echo...
Change:mkMapEntry () {
test -f $6 || { echo "The file $6 does not exist. Skipping $1." 1>&2; return -1; }
echo "CosyMap $1;"
echo "$1.setA($2);"
echo "$1.setQ($3);"
echo...
10,093
Posted By bartus11
Try:awk -F"\t" '$1==$2&&$1=="ndc"{print NR":...
Try:awk -F"\t" '$1==$2&&$1=="ndc"{print NR": "$0}' inputfile
1,666
Posted By bartus11
Try:perl -pe...
Try:perl -pe 's/(([^.]+\.){2}[^.]+).*?(\s+.*)/$1$3/' input.txt
2,558
Posted By bartus11
I'd say this is some kind of bioinformatics data....
I'd say this is some kind of bioinformatics data. Anyway, you can try this in a directory containing your files:
perl -lne '$,="...
752
Posted By bartus11
Try:find $SRC -type f -name *.emlx | while...
Try:find $SRC -type f -name *.emlx |
while read FILE
do
awk '/^From:/ && gsub(/.*<|>.*/,x)' $FILE
done | sort | uniq > ~/Desktop/output.txt
echo "complete"
665
Posted By bartus11
Try:for i in /path/*.rnk; do java -jar commands...
Try:for i in /path/*.rnk; do java -jar commands -res $i -out ${i%.*} -gui false; done
2,176
Posted By bartus11
Try:perl -n0e 'while...
Try:perl -n0e 'while (/TD.*?(?=TD|$)/sg){$x=$&;$x=~/TD:\s*(\w+)/;open $f,">>","$1";print $f $x; close $f}' file
1,724
Posted By bartus11
Try:awk -F"," '/^import/{print $1;for...
Try:awk -F"," '/^import/{print $1;for (i=2;i<=NF;i++) print "import"$i;next}1' input.py
1,015
Posted By bartus11
Try:awk 'NR==FNR{a[$0]=1;next}a[FNR]==1{gsub...
Try:awk 'NR==FNR{a[$0]=1;next}a[FNR]==1{gsub ("H","Na+")}1' test testsds.pdb
2,642
Posted By bartus11
Does it have to be AWK? Try this if not:perl...
Does it have to be AWK? Try this if not:perl -ln0e 'while (/(interface[^\n]+).*?(?=interface|$)/sg){$x=$&;$y=$1;print $y if $x!~/filter-shared 14/ && $y=~/move-group/}' file
1,723
Posted By bartus11
Try:awk '{for (i=1;i<=NF;i++) $i=sprintf...
Try:awk '{for (i=1;i<=NF;i++) $i=sprintf ("%.2f",$i)}1' file
Showing results 1 to 25 of 500

 

Featured Tech Videos

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