Search Results

Search: Posts Made By: muthukumar
14,186
Posted By muthukumar
You have to use dos2unix (linux) or dos2ux...
You have to use dos2unix (linux) or dos2ux (hp-ux) for this. Encoding is getting different from dos to unix with ^M character.

hth.
13,347
Posted By muthukumar
You have taken correct way. $? will give status...
You have taken correct way. $? will give status of prev command. we can not make it with single utility to give return code and redirect output to another log file. You can do it better as,

#...
9,908
Posted By muthukumar
You can do it as, #!/bin/sh # Hour check...
You can do it as,

#!/bin/sh
# Hour check script

if [[ $(date +'%H') -lt 12 ]]
then

perl -pi -e 's/^From_Date_Parm.*$/From_Date_Parm=sysdate - 1 (2005-06-20)/g' TransactionParams
perl...
24,857
Posted By muthukumar
You can use getline utility with awk program as, ...
You can use getline utility with awk program as,

awk '{ getline ln < "file1"; print ln" "$0 }' file

hth.
3,234
Posted By muthukumar
Adding to Ygor point, `ps -ef|grep...
Adding to Ygor point,

`ps -ef|grep $wlPID1|grep -c -v grep` -ne 0 will not work!!

try as,

ps -ef | grep "$wlPID1" | grep -cqv grep

if [[ $? -eq 0 ]]
then
..
fi

-q option with grep...
13,654
Posted By muthukumar
You can make as, #!/usr/bin/ksh F1=jh ...
You can make as,

#!/usr/bin/ksh
F1=jh
y=1
z=1

FS1=`cat $F1 | wc -l`

while [ $y -le $FS1 ]
do
set -xv
z=`expr $y + 1`
st=$y"p"
ed=$z"q"
V1=`sed -n $st\;{$ed\;} < $F1`

echo $y...
2,238
Posted By muthukumar
You can try as, #/bin/bash read -p 'Addr:...
You can try as,

#/bin/bash
read -p 'Addr: " addr
awk '{ if ( $1 ~ "<Address>") { print address } }' address=$addr <filename>

hth.
7,078
Posted By muthukumar
You can try as, cat > script1 #!/bin/sh ...
You can try as,

cat > script1
#!/bin/sh
ls
hostname
uname -a

cat > script2
. ./script1

# chmod 755 script2 (Needed to execute shell script)
# ./script2

or

# sh script2

hth.
4,585
Posted By muthukumar
You can try this easily with, #!/bin/sh ...
You can try this easily with,

#!/bin/sh

while read newfile reffile;
do

> ${newfile}

while read sfile start end
do

if [[ -f ${sfile} ]]
then
sed -n...
8,612
Posted By muthukumar
I hope encrypt function is available in unix but...
I hope encrypt function is available in unix but not the decryption. You can try your own script to generate passwd from some other string.

hth.
3,296
Posted By muthukumar
You can simply try as, echo $((2221753117 +...
You can simply try as,

echo $((2221753117 + 299363384))

hth.
6,248
Posted By muthukumar
Is your mail command working propely without any...
Is your mail command working propely without any problem ?

echo "$MLINE" | mail -s "$HOST - $TEXT" name@co.com

what you are getting for this?

There may be a problem to resolve domain name...
35,407
Posted By muthukumar
Yes. If you want to make this requirement with...
Yes. If you want to make this requirement with one script then proper setup has to be done as,

script running machine --> all other machines

which will not need password for ssh...
109,112
Posted By muthukumar
You can try as, 00 23 * * * [[ $(date +'%d')...
You can try as,

00 23 * * * [[ $(date +'%d') -eq $(cal | awk '!/^$/{ print $NF }' | tail -1) ]] && job 1>/dev/null 2>&1

hth.

Code tags please, thanks.
2,987
Posted By muthukumar
To remote last "," then, awk '{ printf $0","...
To remote last "," then,

awk '{ printf $0"," }END { printf "\n"}' a.txt | sed 's/,$//'

hth.
2,987
Posted By muthukumar
You can do this, awk '{ printf $0","...
You can do this,

awk '{ printf $0"," }END{print "\n"}' <filename>

hth.
9,005
Posted By muthukumar
You can use ping as, ping localhost -n 1 -m...
You can use ping as,

ping localhost -n 1 -m 5

where -m option is used to give timeout option. Default it is with 10 seconds.
-n option is used to give ping count

hth.
35,407
Posted By muthukumar
Another posibility is with NFS as, one specific...
Another posibility is with NFS as, one specific share has to be mounted in all 65 unix machines. With in that you can put user ID, group ID, shell etc.

In the script you have to check whether the...
35,407
Posted By muthukumar
If you have setup for non-interactive login into...
If you have setup for non-interactive login into remote machine with,

1) rsh commands
2) ssh commands
3) expect utility

then you can do it in all machines.

Else exection has to be done in...
1,856
Posted By muthukumar
Problem is because of inifite loop in test1.sh....
Problem is because of inifite loop in test1.sh. It will keep on appending date informations in to 1.log. It will update the file of 1.log if you move anywhere. Operation is being done with kernel...
2,902
Posted By muthukumar
oops. try as, #!/bin/sh # read value in...
oops. try as,

#!/bin/sh
# read value in var variable
read var
if [[ -z $var ]]
then
let var=3
fi
echo $var

hth.
2,975
Posted By muthukumar
You can start " tail -f 'file1' | grep '_RESP'...
You can start "
tail -f 'file1' | grep '_RESP' | grep -v 0x00000000 > 'file2'" in background mode so that it will be running in background and you can view file2 contents.

# tail -f file1 | grep...
2,902
Posted By muthukumar
You can try as, # read value in var variable...
You can try as,

# read value in var variable
read var
if [[ -z $var ]]
then
set var=3
fi

Are you look this one?
1,973
Posted By muthukumar
The problem is file is in DOS format. You can...
The problem is file is in DOS format. You can change it as,

dos2ux <filename> > <outputfile>

hth.
1,856
Posted By muthukumar
>> will append or if the file is not there then...
>> will append or if the file is not there then it creates it again newly. But, It will only append new informations not the old one. You can look it in the new file.

hth.
Showing results 1 to 25 of 117

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