Search Results

Search: Posts Made By: anurag.singh
1,494
Posted By Franklin52
Or: ab=$(echo $dirk | awk '/ab/' RS="...
Or:
ab=$(echo $dirk | awk '/ab/' RS=" ")
2,266
Posted By Chubler_XL
Not worried about the case of running this script...
Not worried about the case of running this script before 4am?
4,206
Posted By Scrutinizer
awk -F'[()]' '/CURDEPTH/ && $2>10{exit 1}'...
awk -F'[()]' '/CURDEPTH/ && $2>10{exit 1}' test1.txt || mailx -s ...
3,730
Posted By methyl
Phew! @anurag.singh When using...
Phew!



@anurag.singh
When using "grep" to search for a string containing space characters, remember to put double quotes round the string.
4,699
Posted By Scrutinizer
Small variation: awk '{sub(/ *$/,x)}...
Small variation:
awk '{sub(/ *$/,x)} NR==FNR{A[$1]=$0;m++;next} NR-FNR==m{B[$1]=$0;next} {print A[$1],B[$2]}' FS=\| OFS=\~ fromfile tofile FS=\~ keyfile
3,748
Posted By Scrutinizer
@anurag
You can leave out \2:
sed 's/^\(ASX1[89]......\)07/\100/;s/^\(ASX1[89]......\)12/\100/' infile


----
GNU sed has alternation as well as back reference:
sed -r...
1,458
Posted By Scrutinizer
I presumed 5:221 to 5:299 should not be...
I presumed 5:221 to 5:299 should not be printed...
awk 'v!=$1{v=$1; a=$2; b=$3} $2>a{a=$2} $3>b{b=$3} {for(i=a;i<=b;i++)print v":"i; a=i}' infile
12,904
Posted By Scrutinizer
Hi, this particular expansion cuts the longest...
Hi, this particular expansion cuts the longest match of space followed by any character off of the end of the string. It is described here with examples: 2.6.2 Parameter Expansion...
1,509
Posted By methyl
Couple of issues here. 1) Environment Variable...
Couple of issues here.
1) Environment Variable names are case-sensitive. $DIR and $dir are not the same variable.
2) Your messages appear to be the wrong way round. When we find no files (and the...
3,934
Posted By Scrutinizer
Try: awk '!/date_conditions/{print $2}' RS=...
Try:
awk '!/date_conditions/{print $2}' RS= infile
1,402
Posted By Franklin52
Maybe something like this? grep -c...
Maybe something like this?
grep -c '^[^$]*DOMAINSOLVER[ \t]*ACMS' file
1,434
Posted By Scrutinizer
@anurag:That should be sort -rnk2, no? Otherwise...
@anurag:That should be sort -rnk2, no? Otherwise number > 9 would not get represented properly..
Also there is no need for temp files and an extra sort step if you sort like this:
sort -k1,1...
33,243
Posted By Franklin52
There's no need to use external commands: ...
There's no need to use external commands:
#!/bin/ksh

while read line
do
id=${line%,*}
name=${line#*,}
echo $id
echo $name
done < temp.txt
Showing results 1 to 13 of 13

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