Search Results

Search: Posts Made By: elixir_sinari
4,957
Posted By elixir_sinari
Can you post the exact command you typed in? Most...
Can you post the exact command you typed in? Most probably you've put everything on one line without using semicolons.
That aside, I never post some solution without verifying that it really does...
10,810
Posted By elixir_sinari
Try: perl -lne 'push @w, /\bA(?:BC|DF)_\w+/g;...
Try:
perl -lne 'push @w, /\bA(?:BC|DF)_\w+/g; END{ print join ", ", @w if @w}' ABC.txt
4,368
Posted By elixir_sinari
You may try this: awk -F, 'FNR==NR{ if(NR>1)...
You may try this:
awk -F, 'FNR==NR{
if(NR>1) a[$1]=$0
next}
{if(FNR==1) next
$2 = ($2 in a ? a[$2] : "NOT FOUND") }
1' OFS=, file2.csv file1.csv
18,630
Posted By elixir_sinari
This will not work. You'll need to tweak it a...
This will not work. You'll need to tweak it a bit:


find /root/files -name "*.gz" 2>/dev/null |while read filename; do cp $filename /root/com/${filename##*/}`date +%Y%m%d_%H%M%S` ; done
3,523
Posted By elixir_sinari
A different type of Perl alternative (if you are...
A different type of Perl alternative (if you are interested):
perl -lpe '@a = split /(:)/, $_, -1; @a = map { ($_+1)%4 ? $a[$_] : "|" } 0..$#a if @a>3;
$_ = join("",@a)' file
This could be easily...
1,672
Posted By elixir_sinari
/\(.\)\1/!d : For all lines not matching the...
/\(.\)\1/!d :
For all lines not matching the pattern, delete the pattern space. The ! is for the pattern and not for the action d. This means that for all lines not having at least 1 consecutive...
3,984
Posted By elixir_sinari
Did you read my post carefully? I said tr -d '\0'...
Did you read my post carefully? I said tr -d '\0' < inputfile and not what you tried.

And, ^@ is the ASCII representation of the null character (in caret notation).
1,915
Posted By elixir_sinari
You seem to be using ksh88, not ksh93. Try: ...
You seem to be using ksh88, not ksh93.
Try:

for i in ab.name.*
do
new=$(echo "$i"|sed 's/^ab/BOX/;s/\./_/g')
echo mv "$i" "$new"
done
8,691
Posted By elixir_sinari
Try using nawk instead of awk. Seems like the...
Try using nawk instead of awk.
Seems like the Solaris awk is accepting only a single-character FS.
9,243
Posted By elixir_sinari
Hi Don, may be you didn't read MadeInGermany's...
Hi Don, may be you didn't read MadeInGermany's reply carefully (or may be it was not well explained). I think he meant that $3=="" is equivalent to $3~/^$/ (the 2nd code fragment in his post).
2,966
Posted By elixir_sinari
What if the last field is the one to be excluded...
What if the last field is the one to be excluded from the output?
2,531
Posted By elixir_sinari
Why use cat at all? Use the shell itself...
Why use cat at all? Use the shell itself geo=$(<geom.txt).
1,930
Posted By elixir_sinari
Assuming ASCII data, try perl -F, -lape 'BEGIN...
Assuming ASCII data, try
perl -F, -lape 'BEGIN { ($tmpl = shift) =~ s/(\d+)/A$1/g }
$_ = pack($tmpl, @F)' "$COLUMNS" "$indir/input_file.dat" > "$outdir/output_file.dat"
2,535
Posted By elixir_sinari
May be: sed '/^#/!s/Test/&1/g' file
May be:
sed '/^#/!s/Test/&1/g' file
3,433
Posted By elixir_sinari
You've badly messed up the command line and the...
You've badly messed up the command line and the logic.

Try:
perl -i.old -ne 'print unless m:^\s*<string>com\.apple\.PhotoBooth</string>\s*$:' ~/Library/Compositions/Compound\ Eye.qtz

I...
6,189
Posted By elixir_sinari
That is incorrect. Check manual page for gawk. ...
That is incorrect. Check manual page for gawk.

@OP:
Check this:
gawk 'BEGIN{
field1="Sdddddfffffggggg"
split(field1,array,"")
print "Pattern : [" array[1] "]"
print "Field 1 :[" field1 "]"...
1,837
Posted By elixir_sinari
In bash, the piped processes run in sub-shells....
In bash, the piped processes run in sub-shells. So, the second exit 1 is only affecting the sub-shell running the while loop and not your whole script.

Try a variant such as:
...
while read i;...
1,270
Posted By elixir_sinari
If you need the functionality of nohup, you could...
If you need the functionality of nohup, you could set a trap for SIGHUP to ignore it and ensure required redirections.
2,232
Posted By elixir_sinari
Technically, the -> is a binary infix dereference...
Technically, the -> is a binary infix dereference operator. In your case, since the right side of the operator is neither an array/hash subscript nor a subroutine argument list, it implies a method...
2,748
Posted By elixir_sinari
Check the delimiters for substitution.
Check the delimiters for substitution.
1,694
Posted By elixir_sinari
You may have a go with this (although I feel...
You may have a go with this (although I feel someone will come up with a better solution soon):
perl -MTime::Local -lne 'if($. > 1) {
/(....)(..)(..)(..)(..)(..)/;...
1,611
Posted By elixir_sinari
Use nawk on Solaris.
Use nawk on Solaris.
2,197
Posted By elixir_sinari
Better to use $1 instead of $0 to avoid skipping...
Better to use $1 instead of $0 to avoid skipping some duplicate numbers due to leading/trailing whitespace.
40,891
Posted By elixir_sinari
In awk, systemreturns the exit status of the...
In awk, systemreturns the exit status of the command and not its standard output (unlike command substitution a.k.a. backticks). So, in your case, date will write to standard output wherever that is...
2,234
Posted By elixir_sinari
In these kinds of fora, others can judge your...
In these kinds of fora, others can judge your level of understanding only through what you mention in your posts; rarely anyone knows anybody else personally to make any appropriate presumptions....
Showing results 1 to 25 of 473

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