Search Results

Search: Posts Made By: anurag.singh
6,885
Posted By anurag.singh
post# 10 will work.
post# 10 will work.
6,885
Posted By anurag.singh
Not very sure but looks like $bootpathf has "/"...
Not very sure but looks like $bootpathf has "/" in it's value as it is a path.
e.g. abc/def/ghi
If so, use following:

sed -i "s#BOOTPATH#$bootpathf#g" $rootfspath.xml


Replace / in sed...
2,298
Posted By anurag.singh
sed 's/\(.\)dwh/\1\ dwh/g' inputFile To...
sed 's/\(.\)dwh/\1\
dwh/g' inputFile

To avoid having 1st line as new line.
3,179
Posted By anurag.singh
awk -F'[:,]' 'NR==FNR{key[$2]=$1;next}{print...
awk -F'[:,]' 'NR==FNR{key[$2]=$1;next}{print $1,$2,$3," "key[$3]}' OFS=, file2 file1 >outputfile
6,885
Posted By anurag.singh
You might be using single quotes. Make sure you...
You might be using single quotes. Make sure you use double quotes.

sed -i "s/BOOTPATH/$bootpathf/g" file.xml

If no good, post your command.
1,197
Posted By anurag.singh
If you only want to replace 1st field to 1, ...
If you only want to replace 1st field to 1,

sed '/\([0-9]*\)/1/' data
OR (if 1st field has only one length data)

sed '/\(.\)/1/' data
OR

sed '/\([^ ]*\)/1/' data

* can be removed if 1st...
3,298
Posted By anurag.singh
awk '/------------/{nr=NR;next} NR==nr+2'...
awk '/------------/{nr=NR;next} NR==nr+2' inputFile
49,793
Posted By anurag.singh
paste File1.txt File2.txt File3.txt File4.txt ...
paste File1.txt File2.txt File3.txt File4.txt

works for me. You may try:

paste -d'\t' File1.txt File2.txt File3.txt File4.txt
1,532
Posted By anurag.singh
Pls provide an expected output for above input.
Pls provide an expected output for above input.
1,791
Posted By anurag.singh
awk 'NR==FNR{a[$1]++;next}{if(!a[$1]) print $0}'...
awk 'NR==FNR{a[$1]++;next}{if(!a[$1]) print $0}' data_1 data_2
49,793
Posted By anurag.singh
Your current output and desired output look same....
Your current output and desired output look same.
Also you didn't mention the inputs completely. Pls mention sample of each file content, expected out, current output, the command you are tried.
Forum: Linux 01-17-2011
2,218
Posted By anurag.singh
#!/bin/ksh echo "Enter the search patterh: " ...
#!/bin/ksh
echo "Enter the search patterh: "
read a
grep "$a" *.rep
15,318
Posted By anurag.singh
always post exact input (or most generalized...
always post exact input (or most generalized one). Try following:
echo "**abcd **1234** efgh**" | sed "s/\*\*/'''/2;s/\*\*/'''/2"OR
echo "**abcd **1234** efgh**" | sed...
15,318
Posted By anurag.singh
echo "abcd **1234** efgh" | sed...
echo "abcd **1234** efgh" | sed "s/*/'/g"
8,709
Posted By anurag.singh
awk '$12 != 0.0015' inputFile
awk '$12 != 0.0015' inputFile
Forum: Solaris 01-14-2011
1,739
Posted By anurag.singh
try: export output=$(crontab -l | grep GBOUAT8...
try:
export output=$(crontab -l | grep GBOUAT8 | grep UTP | grep -i stop | sed 's/\\//')
18,928
Posted By anurag.singh
Yes, Bottom up is not needed. Thanks.
Yes, Bottom up is not needed. Thanks.
1,489
Posted By anurag.singh
ab=$(echo $dirk | awk '{for(i=1;i<=NF;i++)...
ab=$(echo $dirk | awk '{for(i=1;i<=NF;i++) if(index($i,"ab")){print $i;exit;}}')
1,835
Posted By anurag.singh
awk -F'[/"]' '{print $5,$7}' inputFile
awk -F'[/"]' '{print $5,$7}' inputFile
1,871
Posted By anurag.singh
#!/bin/ksh i=1 while [ i -le 10000 ]; do ...
#!/bin/ksh
i=1
while [ i -le 10000 ]; do
touch file$i
i=$(expr $i + 1)
done
35,191
Posted By anurag.singh
Execute script as: a.sh 20110114 "b c d"And...
Execute script as:
a.sh 20110114 "b c d"And pass 2nd argument in quotes to sql proc:
<sql_proc> "$2"
But not very sure about sql procedure. If above doesn't work, then you may do following:...
35,191
Posted By anurag.singh
As you can see above, In my script output, a.sh...
As you can see above, In my script output,
a.sh 20110114 'b c d'
arguments count ($#) is 2
1st argument ($1) is 2011011
2nd aguument($2) is b c d

If you are passing your argument to some other...
18,928
Posted By anurag.singh
bottom up way: sed '311,592 d;105,107 d;53,59...
bottom up way:
sed '311,592 d;105,107 d;53,59 d;10,51 d' infile > outfile
2,255
Posted By anurag.singh
Thanks Chubler_XL. It should be: date...
Thanks Chubler_XL. It should be:
date '+%d/%b/%Y:%H' | awk -F: '{printf("%s:%02d\n",$1,$2>=4?$2-4:24-(4-$2))}'
35,191
Posted By anurag.singh
#!/bin/sh echo $# echo $1 echo $2 echo $3...
#!/bin/sh
echo $#
echo $1
echo $2
echo $3
When I run it as:
a.sh 20110114 'b c d'
I get following:
2
20110114
b c d


Please mention what exactly you are doing.
Probably code snippet,...
Showing results 1 to 25 of 413

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