Search Results

Search: Posts Made By: himvat
Forum: UNIX and Linux Applications 05-10-2011
24,851
Posted By himvat
How to log out of the server in such a manner that you are not logged out of PUTTY?
Hi,

I am using EXIT command to log out of the server, But this logs me out of the Putty. Is there any way that I can still be present on Putty and just log out of the server.

Every time I...
2,114
Posted By himvat
[ ! -z $4 ]
Hi ,



What is the significance of " $ " in [ ! -z $4 ] .



Kindly guide.

Regards
Forum: Linux 12-25-2008
9,522
Posted By himvat
C Compiler on LINUX
Hi,

I am a new user for LINUX. I have started learning C programming. I have heard that there is gcc & g++ compilers already available on LINUX by default.

Kindly guide where to find these...
1,778
Posted By himvat
[ ! -e a.log ] & [ ! -f a.log ] difference b/w these two
if [ ! -e a.log ]; then
touch a.log
fi

...................................

if [ ! -f a.log ]; then
touch a.log
fi



Hi ,

Are the above two meant for same purpose i.e...
1,122
Posted By himvat
Variable
Hi ,

If "c.log" is a file. This file contains a number.

How to assign the content of file "c.log" as a variable ?

Please guide

regards
5,860
Posted By himvat
read iCOUNT < tmp_file.log echo $fCOUNT >...
read iCOUNT < tmp_file.log

echo $fCOUNT > tmp_file.log

iCOUNT=$fCOUNT



I would really appreciate if you could explain the purposes of the above mentiond commands

Regards
5,860
Posted By himvat
1) There is only one file to be scaned ...
1) There is only one file to be scaned

2)This file will be scaned after every 1 hour.

3) Let us suppose we scan the file right now . And suppose this gives us a count of ERROR as 5 . We will...
5,860
Posted By himvat
kindly advice ...how to proceed further ??
kindly advice ...how to proceed further ??
5,860
Posted By himvat
YES !! it worked. Now this script will be...
YES !! it worked.

Now this script will be run again after few minutes again.
At this time we need to take count in the fCOUNT in the last scan. This will be taken as the previous count of errors....
5,860
Posted By himvat
Actually I am trying to make a script that will...
Actually I am trying to make a script that will scan for the errors in the log file. It will compare the previous count of the errors found in the last count with the current count of errors in the...
5,860
Posted By himvat
while do done loop problem
#!/bin/sh
findit=`find . -name "a.log" | wc -l`
if [ $findit -eq 0 ]; then
touch a.log
fi
iCOUNT=`grep ERROR a.log | wc -l`
while (1)
do
fCOUNT=`grep ERROR b.log | wc -l`
if [...
8,841
Posted By himvat
I think , it will move the last fCOUNT to a.log.
I think , it will move the last fCOUNT to a.log.
8,841
Posted By himvat
can I try as below ?? $fCOUNT >...
can I try as below ??



$fCOUNT > a.log
8,841
Posted By himvat
This should forward the count in fCOUNT to a.log....
This should forward the count in fCOUNT to a.log. When the a.log was created there was no number into that. The number comes to fCOUNT. When the log file is scanned after few minutes , this fCOUNT...
8,841
Posted By himvat
#!/bin/sh findit=`find . -name "a.log" | wc -l`...
#!/bin/sh
findit=`find . -name "a.log" | wc -l`
if [ $findit -eq 0 ]; then
touch a.log
fi
iCOUNT=`grep ERROR a.log | wc -l`
while (1)
do
fCOUNT=`grep ERROR b.log | wc -l`
if [...
8,841
Posted By himvat
Now I have extended the same script further for a...
Now I have extended the same script further for a comparison between counts of ERROR in two files .



#!/bin/sh
findit=`find . -name "a.log" | wc -l`
if [ $findit -eq 0 ]; then
touch a.log...
8,841
Posted By himvat
actually I am a bit confused between [ -eq 0 ] &...
actually I am a bit confused between [ -eq 0 ] & [-eq 1 ]

can u please differetiate between these two ?

i think [ -eq 0 ] means condition is true or file found

&

[ -eq 1 ] means...
8,841
Posted By himvat
yes it is working !!! but cant I make it...
yes it is working !!!

but cant I make it like below ?



#!/bin/sh
findit=`find . -name "a.log" | wc -l`
if [ $findit -eq 1 ]; then
touch a.log
fi



I tried this but it did not work
8,841
Posted By himvat
Yes !! It worked ...thanks Now I am...
Yes !!

It worked ...thanks

Now I am trying to make a script which creates a file "a.log" if it does not find the file "a.log"

I am using the following script.



#!/bin/sh
findit=`find...
8,841
Posted By himvat
I have tried the following script :- ...
I have tried the following script :-




#!/bin/sh
findit='find . -name "a.log" | wc -l'
if [ $findit -eq 0 ]; then
echo "1"
else
echo "0"
fi



and I am getting the below result when...
8,841
Posted By himvat
I have tried the following script :- ...
I have tried the following script :-




#!/bin/sh
findit='find . -name "a.log" | wc -l'
if [ $findit -eq 0 ]; then
echo "1"
else
echo "0"
fi



and I am getting the below result when...
8,841
Posted By himvat
Why are we using " wc -l " here ??
Why are we using " wc -l " here ??
8,841
Posted By himvat
ok ...that means i have to declare the variable...
ok ...that means i have to declare the variable ....let me just try your way..

thanks...will inform you regarding the result...
8,841
Posted By himvat
problem in if then else condition
Hi ,

I am trying the following simple script . But it is always giving 1 output. Dont know why



#!/bin/sh
find . -name "a.log"
if [ $? -eq 0 ] ; then
echo "1"
else
echo "0"
fi


...
7,808
Posted By himvat
./b.sh /b.sh: line 7: syntax error near...
./b.sh
/b.sh: line 7: syntax error near unexpected token `fi'
/b.sh: line 7: `fi'



now it is showing this error
Showing results 1 to 25 of 66

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