Search Results

Search: Posts Made By: venkatareddy
2,226
Posted By venkatareddy
Hi, you can append to the file in the...
Hi,
you can append to the file in the following format

echo "T|$count " >>$fn.txt

incase if it needs to printed in new line

echo -e "\n T|$count " >> $fn.txt

thanks,
venkat
25,094
Posted By venkatareddy
Hi, you can achieve that with the following...
Hi,
you can achieve that with the following code


$ cat file.txt | sed 's/|/\t/g'
abc 123 2012-01-30 2012-04-28 xyz


thanks,
venkat
2,244
Posted By venkatareddy
Hi, you can acheive that with the following...
Hi,
you can acheive that with the following command
$ ls *1.txt|zip source -@
adding: a1.txt (deflated 90%)
adding: c1.txt (deflated 25%)
adding: d1.txt (deflated 25%)

thanks,...
4,935
Posted By venkatareddy
Hi, you can use the command top $ top ...
Hi,
you can use the command top

$ top
top - 18:15:55 up 8:23, 0 users, load average: 0.00, 0.00, 0.00
Tasks: 3 total, 1 running, 2 sleeping, 0 stopped, 0 zombie
Cpu(s): 2.6%...
1,224
Posted By venkatareddy
Hi, you can try with this $ echo...
Hi,
you can try with this
$ echo "xx\zz\yy"|awk -F\\ '{print $NF}'
yy

$ echo "xx\zz\yy\ss"|awk -F\\ '{print $NF}'
ss

thanks,
venkat
2,020
Posted By venkatareddy
Hi, you can achieve that using bc as follows...
Hi,
you can achieve that using bc as follows
$ echo " scale=3;2/4"|bc -l
.500

thanks,
venkat
2,886
Posted By venkatareddy
hi, you can remove the ctrl+M character by...
hi,
you can remove the ctrl+M character by running the following command on file

dos2unix export.tsv export.tsv
thanks,
venkat

Moderator comment: Syntax should be:

dos2unix export.tsv...
1,393
Posted By venkatareddy
Hi, then do with filename appending with...
Hi,
then do with filename appending with date
$ date +'%m%d_%H%M%S'
0124_120358

like filename."_"`date +'%m%d_%H%M%S'`

ex:-
$ echo "filename"_"`date +'%m%d_%H%M%S'`"...
1,393
Posted By venkatareddy
Hi, you can achieve that using the $RANDOM...
Hi,
you can achieve that using the $RANDOM variable appending to the file name

you can check the random variable exists in your setup or not

$ print $RANDOM $RANDOM
29302 8082


it...
31,035
Posted By venkatareddy
Hi, you can use this way with egrep ...
Hi,
you can use this way with egrep

egrep "word1.*word2" file

thanks,
venkat
Forum: AIX 01-18-2012
2,014
Posted By venkatareddy
Hi, you can extract the IP address like...
Hi,
you can extract the IP address like this


bash-3.2$ who -Hu|grep admin|awk '{print $7}'
(10.72.186.23:1.0)
(10.72.186.24:1.0)
(10.72.186.23:1.1)
(10.72.186.23:1.2)


thanks,...
Forum: AIX 01-18-2012
2,014
Posted By venkatareddy
Hi, you can use the command who with -u...
Hi,
you can use the command who with -u option it will list all the user who were logged in


bash-3.2$ who -Hu
NAME LINE TIME IDLE PID COMMENT
gupendra...
28,284
Posted By venkatareddy
Hi, right click on the top of cygwin...
Hi,
right click on the top of cygwin terminal ->options ->text under Font click on
select and set whatever size u want

thanks,
venkat
34,052
Posted By venkatareddy
bash-3.2$ sh sc.sh line is empty line is...
bash-3.2$ sh sc.sh
line is empty
line is empty
line is empty
line is empty
Total line=3
bash-3.2$ uname
Linux
bash-3.2$ cat sc.sh
#! /bin/bash
clear
rdCount=0;
while read myline
do
if...
34,052
Posted By venkatareddy
Hi, it looks in space is counted as string...
Hi,
it looks in space is counted as string when we use -z it checks for size


$ uname
CYGWIN_NT-5.1

btw, your OS

thanks,
venkat
34,052
Posted By venkatareddy
Hi, when i run the script w.r.t to this code...
Hi,
when i run the script w.r.t to this code it is reporting 3 only


$ sh script.sh
line is empty
line is empty
line is empty
Total line=3

$ cat script.sh
#! /bin/bash
clear...
27,427
Posted By venkatareddy
Hi, Both are same w.r.t functionality ,...
Hi,
Both are same w.r.t functionality , This variable points to the current directory

But $PWD is an environmental variable which can be used to set to a particular session/shell /script
...
1,614
Posted By venkatareddy
Hi, Please use this code $ sed -n...
Hi,
Please use this code

$ sed -n '/from/,/where/p' f1.txt|awk '{print $4}'

O/p:-
----
$ sed -n '/from/,/where/p' f1.txt|awk '{print $4}'
xyz
abc


$ cat f1.txt
select * from...
4,307
Posted By venkatareddy
Hi, you can use this way also yes|rm -rf...
Hi,
you can use this way also
yes|rm -rf gcc-3.4.2/

thanks,
venkat
34,052
Posted By venkatareddy
Hi, Please try with this #! /bin/bash ...
Hi,
Please try with this
#! /bin/bash
clear
rdCount=0;
while read myline
do
if [ -z "${myline}" ]; then
echo "line is empty"
else
echo $myline
let rdCount=$rdCount+1
fi...
2,937
Posted By venkatareddy
Hi, use 3 echo like echo |echo|echo /*** The...
Hi,

use 3 echo like echo |echo|echo /*** The command *****/

thanks,
venkat
1,943
Posted By venkatareddy
Hi, you can use this command for listing...
Hi,
you can use this command for listing your desired case

last|grep -v 'still logged in'

o/p :- doesnt contain the still logged in users info

thanks,
venkat
2,937
Posted By venkatareddy
hi, i think this is the place where you...
hi,
i think this is the place where you need to keep echo /pass enter
echo |ssh-keygen > /dev/null
echo |ssh-copy-id -i ~/.ssh/id_rsa.pub ${vars[0]} > /dev/null 2&>1
for (( i=0; i <...
2,937
Posted By venkatareddy
Hi, you can pass Enter like this too echo...
Hi,
you can pass Enter like this too
echo |sh script.sh

a simple echo will return new line

thanks,
venkat
Forum: Red Hat 01-12-2012
1,921
Posted By venkatareddy
Hi, You can find the commands executed...
Hi,
You can find the commands executed information by the command history

or even you can open and see the file .bash/csh/ksh_history in your home directory

cat ~/.bash_history


522 ...
Showing results 1 to 25 of 46

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