Search Results

Search: Posts Made By: harish612
2,533
Posted By harish612
Actually its not allowed in production...
Actually its not allowed in production environment as we need to run through query id
Through backgroud id we can but we have to run it only through query id

So I am looking for an alternative...
2,533
Posted By harish612
listing file date and time without usage of pipe
Hi ,
I am using below code to list the 6th,7th and 8th field of the file


ls -lrt test | awk '{print $6,$7,$8}'


output:

Nov 21 19:34


Now the problem here is that I want to do it...
13,411
Posted By harish612
Hi, Can you try with this code . It worked for...
Hi,
Can you try with this code . It worked for me


ls -lrt | sed 's/beach_//g'


Regards,
Haris
1,529
Posted By harish612
Hi, You can try with below code ls -1...
Hi,
You can try with below code


ls -1 | sed 's,...$,,g'



Regards,
Haris
2,770
Posted By harish612
You can try below tput bold awk -F "|"...
You can try below


tput bold
awk -F "|" '{print $3}' file



Output:


Acct 0110855565
Acct 2063947620


Regards,
Haris
2,434
Posted By harish612
you can check for both the commands using man...
you can check for both the commands using man page

man awk
man basename

you can use in below manner . this code will give you only test in the output

basename test.txt .txt


you can...
2,434
Posted By harish612
"echo" is command used for printing purpose eg...
"echo" is command used for printing purpose
eg : below will print test to the prompt


echo "test"


"tee -a" command is used for appending purpose
You can check using man pages how to...
9,334
Posted By harish612
try with below if [ -f filename ];...
try with below



if [ -f filename ]; then
echo "file exists"
else
echo "file does not exist"
#here you can put the logic for sending mail
fi


Cheers
Harish
1,649
Posted By harish612
Is there any option like egrep -o ??? Just...
Is there any option like egrep -o ???
Just check the man pages

You are working on which OS

infile

ABCDE (x,y,z,abc)



egrep y.* infile


If you give above code it will give...
55,113
Posted By harish612
Try with below i=0; if [ $i -eq 0 ]; then ...
Try with below

i=0;
if [ $i -eq 0 ]; then
echo inside if
fi


In case you want to debug your script put below code at the very beginning


set -x


Cheers
Harish
7,425
Posted By harish612
I think generally the file names are not space...
I think generally the file names are not space separated
Moreover the reply was in context of the file names mentioned above in the first post
So for that case above will work fine

Cheers...
7,425
Posted By harish612
try with below code list=`ls *.sh` echo...
try with below code

list=`ls *.sh`
echo $list | tr -s '\040' '\012'


Cheers
Harish
9,068
Posted By harish612
In below case I am just viewing both the...
In below case I am just viewing both the file1.xml i.e in a.ear and b.ear
If you want you can also edit them

a.ear file1.xml


this is a.ear file1.xml


b.ear file1.xml


this is...
9,068
Posted By harish612
try with below code for i in `ls -l *.ear |...
try with below code

for i in `ls -l *.ear | awk '{print $NF}'`
do
jar xvf $i
done


In case you want to give the filename at run-time then try below code

test.sh 1.ear


jar xvf $1...
1,684
Posted By harish612
try with below rand_x=1 rand() { ...
try with below


rand_x=1
rand()
{
rand_x=$(((($rand_x * 1103515245) + 12345) % 4294967296))
echo $rand_x >&2
return $rand_x
}
while true; do
rand
printf '%i %i\n'...
2,221
Posted By harish612
cant figure out where exactly you are getting...
cant figure out where exactly you are getting error for below


awk -F "," '{print $1","}' test.txt



Output with above command

jjkj,
kijljlj,
kjkljlkj,


If you want you can...
2,221
Posted By harish612
try with below code cat test.txt ...
try with below code

cat test.txt

jjkj,iiuiui,ijlkjkij,ookoo
kijljlj,jhhkj,ijijkijkj,oijkijj
kjkljlkj,kjkjlkjlkj,opok,okop



awk -F "," '{print $1","}' test.txt



Cheers
Harish
3,591
Posted By harish612
Try below code sed '5,14d' inputfilename...
Try below code


sed '5,14d' inputfilename > newfilename


Cheers
Harish
25,031
Posted By harish612
Venikathir, Try with below code rm -f...
Venikathir,
Try with below code


rm -f newfile.txt
while read line
do
line1=`grep -ie "${line}" 2.txt `
if [ $? -ne 0 ] ; then
echo "$line" >> newfile.txt
fi
done <1.txt

...
3,055
Posted By harish612
Amit, You can also try with below code But...
Amit,
You can also try with below code
But this will search the 3rdjuly.txt for each line of the 4thjuly.txt

For eg :
Even if the 4thjuly.txt line 2 and 3rdjuly.txt line 2 are not same but...
6,794
Posted By harish612
Bharath, Please check below code and try to run...
Bharath,
Please check below code and try to run using

<scriptname> <filename>



filename=$1
filedate=`ls -lrt $filename| awk '{print $7}'`
filetimestamp=`ls -lrt $filename | awk '{print...
3,055
Posted By harish612
Amit, Please check below.I have take the input...
Amit,
Please check below.I have take the input 3rdjuly.txt and 4thjuly.txt
as per the your very first post
The results are same as you are expecting

Input:

cat 3rdjuly.txt...
3,055
Posted By harish612
try with below In this the difference between...
try with below
In this the difference between 3rdjuly.txt and 4thjuly.txt will be put into newfile.txt
since in this case 4thjuly.txt will have 3rdjuly.txt records as well as few
new records the...
3,055
Posted By harish612
try with below code rm -f...
try with below code



rm -f newfile.txt
while read line
do
line1=`grep -ie "${line}" 3rdjuly.txt`
if [ $? -ne 0 ] ; then
echo "$line" >> newfile.txt
fi
done < 4thjuly.txt

...
6,794
Posted By harish612
Run below script using <scriptname> ...
Run below script using

<scriptname> <filename>



filename=$1
filetimestamp=`ls -lrt $filename| awk '{print $7}'`
current_date=`date +%d`
a=`expr $current_date - $filetimestamp`
if [...
Showing results 1 to 25 of 28

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