Search Results

Search: Posts Made By: danielos
1,732
Posted By danielos
Hi! Ok, I have fixed a bit of code: ...
Hi!
Ok, I have fixed a bit of code:

#!/usr/bin/ksh

awk '$0 ~ /\(/, $0 ~ /PRIMARY/ {print $1,$2}' file1 | while read variable type_file1
do
[[ "${variable}" = *[A-Za-z_] ]] &&
(
...
7,137
Posted By danielos
Yes, you have to change the condition. [ !...
Yes, you have to change the condition.

[ ! -s "TCM_HC_ERR_Report.txt" ] && echo "file empty" || cat TCM_HC_ERR_Report.txt
7,137
Posted By danielos
If you are using sh you have to use: if [ !...
If you are using sh you have to use:

if [ ! -s "TCM_HC_ERR_Report.txt" ]
then
cat TCM_HC_ERR_Report.txt
else
echo "Empty or not exist"
fi
7,137
Posted By danielos
If you have the file "TCM_HC_ERR_Report.txt" in...
If you have the file "TCM_HC_ERR_Report.txt" in the same directory which is the script, it must work, on the other hand...you should declare a variable, for example "file" and to assign to this the...
7,137
Posted By danielos
if [[ ! -s $file ]]; then cat $file else...
if [[ ! -s $file ]];
then
cat $file
else
echo "Empty or not exist"
fi
1,821
Posted By danielos
Hi aimy! First, I think it's not necessary to...
Hi aimy!
First, I think it's not necessary to do an "echo" in file_name.
As Rudic says you must to export you ORACLE_HOME first. Then you only have to pass the name of file to function. For...
1,732
Posted By danielos
I propose you a solution, maybe it is not the...
I propose you a solution, maybe it is not the best one but you have to correct a bit of code but it works.


awk '$0 ~ /\(/, $0 ~ /PRIMARY/ {print $1,$2}' kk | while read var tipo
do ...
10,617
Posted By danielos
Hi, in awk $0 is the whole line. If you want only...
Hi, in awk $0 is the whole line. If you want only one field of the line you have to check for i=1 to NF.
$0 = $1 + $2 +.....NF. You have to know the length of $1 ,$2.... and compare them. For...
1,669
Posted By danielos
Hi! You can use also... cat Test1.dat | nawk...
Hi! You can use also...

cat Test1.dat | nawk -v var="20120912" 'BEGIN{count=0}\
{if ($0 ~ var) ++count;}
END{print count}'
Showing results 1 to 9 of 9

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