Search Results

Search: Posts Made By: sayami00
1,496
Posted By sayami00
Dear RudiC and Raj , Thanks a lot . Both...
Dear RudiC and Raj ,

Thanks a lot . Both code are working for me .
1,496
Posted By sayami00
Dear Don, Please find my answer : 1) I have...
Dear Don,
Please find my answer :
1) I have tried like this
egrep "0221|09|ccc" test.unl | awk -F "|" 'maxvalue=="" || $3 > maxvalue { maxvalue=$3 } END { print "ccc|"maxvalue }'
With this I...
1,496
Posted By sayami00
Getting max value of specific fields with awk
Hello All,

Here is am trying to get maximum value of third field depending on
first,second and fourth fields with awk command . delimeter is pipe(|) .

input

0221|09|14.25|aaa...
4,175
Posted By sayami00
You can try with like this also . I am not using...
You can try with like this also . I am not using sed here.

awk -v place=`awk '$1~/apple/ {a=a+1;if(a==2){b=NR}} END {print b} ' file1` '{ if(FILENAME == "file1" && NR <=place) { print };...
90,593
Posted By sayami00
it will work for both file and directory . ...
it will work for both file and directory .

>ls -altr
total 8
drwxr-x--- 12 abc 123 4096 Apr 25 12:31 ..
-rw-r----- 1 abc 123 0 Apr 25 12:31 tarfile.txt...
90,593
Posted By sayami00
try with this :- for tar tar -cvf...
try with this :-
for tar
tar -cvf tarfile.tar tarfile
for untar
tar -xvf tarfile.tar

for tar and compress
tar -cvf - tarfile | gzip -c > tarfile.tar.gz
for untar and decompress
gzip...
1,654
Posted By sayami00
you can also try like this for getting common...
you can also try like this for getting common from all three files .

awk -F "." '{if(FILENAME=="server1"){flag1[$1]=1;}else if(FILENAME=="server2"){flag2[$1]=1;}else{if(flag1[$1]==1 &&...
8,007
Posted By sayami00
Thanks a lot ..Robin and RudiC for your...
Thanks a lot ..Robin and RudiC for your suggestion .
1,040
Posted By sayami00
Hi, If all other records in your input file...
Hi,

If all other records in your input file are as per sample input provided . then you can try with this one :-

sed -e 's/\[\]//g' -e 's/\] \[/|/g' -e 's/\] \[/|/g' -e 's/\] /|/g' -e 's/\]...
8,007
Posted By sayami00
@ajju, when value of $m is 04(4th month), then...
@ajju,
when value of $m is 04(4th month), then value of $month will be 3 with following expression.
month=`expr "$m" - 1`


Below codes are used for obtaining output as 03(as per your...
8,007
Posted By sayami00
IN AIX , I have also faced same problem for ...
IN AIX , I have also faced same problem for getting previous date .

I am using following codes .

year=`date +%Y`
m=`date +%m`
month=`expr "$m" - 1`
if [ "$month" -le "10" ] ; then...
1,723
Posted By sayami00
try this :- for loop in `ls...
try this :-

for loop in `ls ABCD_PQRSTUVW_XYZ_20140205193338_00172_1.DAT`
do
new_file=`echo $loop | awk -F "_" '{print $1"_"$2"_"$4".DAT"}'`
mv $loop $new_file
done


same code in single...
Forum: Red Hat 03-28-2014
5,025
Posted By sayami00
Because of /bin/false , it was problem .After...
Because of /bin/false , it was problem .After changing /bin/false to /bin/bash it was ok for me .
log in with other user and what is the log in shell in /etc/passwd file .

I have given another...
Forum: Red Hat 03-28-2014
5,025
Posted By sayami00
I have faced similar type of problem . for me ,...
I have faced similar type of problem .
for me , /etc/passwd file was changed like this

root:x:0:0:root:/root:/bin/false

login shell was changed to /bin/false .
2,774
Posted By sayami00
Does below command gives any output ? ...
Does below command gives any output ?

/usr/sbin/ifconfig -a | awk '/flags/ {print $1}' | grep -v lo | sed 's/://g'



try with this first . whats the content of file /tmp/logfile_1 and...
10,347
Posted By sayami00
If sample provided will be same for all the...
If sample provided will be same for all the records , then you can try as follows

awk -v d=2014-03-24 -F'"' 'substr($1,2,10)==d && substr($2,1,10)==d && $1~/ERROR/ {print...
1,327
Posted By sayami00
you can try like this :- suspend execution of...
you can try like this :-
suspend execution of script for few seconds before removing file .

sleep 2
rm report_location.txt
16,510
Posted By sayami00
Try this one also :- cur_dir=`pwd` for...
Try this one also :-
cur_dir=`pwd`
for loop_dir in `ls -altr | awk '{if($9!="." && $9!=".." && $9!="")print $9}'`
do
cd $cur_dir
if [ -d $loop_dir ] ; then
cd $cur_dir/$loop_dir
for...
915
Posted By sayami00
Try this one ftp -i -n -v ${FTP_HOST} <<EOF ...
Try this one
ftp -i -n -v ${FTP_HOST} <<EOF
user ${FTP_USER} ${FTP_PASSWORD}
ls ${FTP_DIR}/*.txt ${BUSINESS_DATE}_FTP_FILES.txt
bye
EOF
if directory exists , then will...
2,159
Posted By sayami00
You can try this with Shell like below :_ ...
You can try this with Shell like below :_


#!/bin/sh
awk 'BEGIN{print "NAME\tTIME\tLinux\tUNIX"}' > output.txt
grep -i mem test | paste -s - | awk '{print $3"\t"$2"\t"$4"\t"$8}' >>output.txt...
17,021
Posted By sayami00
Try this one :- # sort -k 6 -n sort.unl ...
Try this one :-
# sort -k 6 -n sort.unl
NAME BIRTHDAY SEX LOCATION AGE ID
Rei 08/25/1990 F Korea 24 33
Jane 02/24/1985 F India 29 78
Jim 05/11/1986 M Japan 27 86
Showing results 1 to 21 of 21

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