Search Results

Search: Posts Made By: mona
Forum: Linux 04-02-2007
5,705
Posted By mona
To copy file cp source dest To get the...
To copy file
cp source dest
To get the current directory detail
pwd
2,082
Posted By mona
Try this egrep...
Try this

egrep '[^]0-9a-zA-Z:;<>=\?@\[\\\^\_`]' <filename>
49,998
Posted By mona
This will give you the current shell echo $0 ...
This will give you the current shell
echo $0
This will give you the login SHELL
echo $SHELL
2,082
Posted By mona
cat -vet <filename> This will display all the...
cat -vet <filename>
This will display all the control characters. ^ and $ represents the start and end of Line.
15,696
Posted By mona
This? $ cat smp.ksh #!/bin/ksh ...
This?

$ cat smp.ksh
#!/bin/ksh
num=00000100
print $num
typeset -i num
print $num

$ ./smp.ksh
00000100
100
$
1,450
Posted By mona
This? ls -lt | egrep...
This?

ls -lt | egrep '*CLIENTINVOICE[0-9]*.archived'
19,300
Posted By mona
In the first command, I am taking the files with...
In the first command, I am taking the files with name "abc_*.txt". Since i have used -t in the ls command, the file which is created recently will always come first. Then awk will pass the filenames...
7,145
Posted By mona
Just include that in a shell script ...
Just include that in a shell script

#!/bin/ksh
in_total=`cat in_file | awk -F: '{in_total += $1 * 86400 + $2 * 3600 + $3 * 60 + $4} END {printf "%d\n",in_total} '`
out_total=`cat out_file | awk...
19,300
Posted By mona
To retain the latest file created with name...
To retain the latest file created with name abc*.txt and to remove the remaining,

ls -lt abc_*.txt | awk '{if(NR!=1) print $9}' | xargs -i rm {}

Another approach. This is based on the...
45,572
Posted By mona
I seem to have misunderstood the requirement....
I seem to have misunderstood the requirement. Hope below is the required soln.

$ sed '$ s/^\(.*\)$/\1qrst/' xyz.txt
abcdef
ghijklm
nopqrst
45,572
Posted By mona
Using sed $ cat xyz.txt abcdef ghijklm ...
Using sed

$ cat xyz.txt
abcdef
ghijklm
nop
$ sed '$ a\qrst' xyz.txt
abcdef
ghijklm
nop
qrst
$ sed '$ a\qrst' xyz.txt > abc.txt
$ mv abc.txt xyz.txt
$ cat xyz.txt
abcdef
ghijklm
nop...
4,761
Posted By mona
Please try this $ cat smp.csh #!/bin/ksh ...
Please try this

$ cat smp.csh
#!/bin/ksh
for i in `cat smp`
do
num=`echo $i | sed 's/^.*[a-zA-Z]0*\([0-9]*\)$/\1/'`
chr=`echo $i | sed 's/^\(.*[a-zA-Z]0*\)[0-9]*$/\1/'`
(( num1 = num + 1 ))...
2,630
Posted By mona
Using awk $ awk -F"," '{gsub(/...
Using awk


$ awk -F"," '{gsub(/ .00/,"0.00",$0);gsub(/ \./,"0.",$0);print $0}' tmp.txt
RECORD ID,CLIENT,CUSTOMER NAME,2883,12:05,8, 16.39, 191.34
RECORD ID,CLIENT,CUSTOMER...
2,630
Posted By mona
Try this sed -e 's/ \.00/0.00/g' -e 's/...
Try this

sed -e 's/ \.00/0.00/g' -e 's/ \(\.[0-9]*\)/0\1/g' -e 's/,\(\.[0-9]*\)/0\1/g' tmp.txt
2,630
Posted By mona
Hope this helps $ awk -F"," '{gsub(/...
Hope this helps

$ awk -F"," '{gsub(/ .00/,"0.00",$7);gsub(/ .00/,"0.00",$8);print $1","$2","$3","$4","$5","$6","$7","$8}' tmp.txt
RECORD ID,CLIENT,CUSTOMER NAME,2883,12:05,8, 16.39, 191.34...
4,761
Posted By mona
Using a script $ cat smp.csh #!/bin/ksh ...
Using a script

$ cat smp.csh
#!/bin/ksh
for i in `cat smp`
do
num=`echo $i | sed 's/^\([a-zA-Z]*0*\)\([0-9]*\)$/\2/'`
chr=`echo $i | sed 's/^\([a-zA-Z]*0*\)\([0-9]*\)$/\1/'`
(( num1 = num +...
7,530
Posted By mona
I found this book...
I found this book (http://www.amazon.ca/Introduction-UNIX-Forouzan/dp/0534951597) very useful for beginners.
1,583
Posted By mona
Will this help? $ cat tmp %is xxx = 123 ...
Will this help?

$ cat tmp
%is xxx = 123
$ sed 's/^\(%is xxx = \)[0-9]*\( *.*\)$/\11234\2/g' tmp
%is xxx = 1234
2,889
Posted By mona
Try this command sed...
Try this command


sed '/\/home\/test\/filelist.txt/ d' srcfile
Forum: Programming 11-13-2006
5,973
Posted By mona
$ cat sample 1234 9876 6789 5677 3452 ...
$ cat sample
1234 9876 6789 5677 3452
9087 4562 1367 2678 7891
$ sed 's/\( \)\{1,\}/,/g' sample
1234,9876,6789,5677,3452,
9087,4562,1367,2678,7891
$

or

$ sed 's/ \+/,/g'...
32,514
Posted By mona
The colon should not cause any problems. Oracle...
The colon should not cause any problems. Oracle will do internal type conversion if the "code" column is number.
32,514
Posted By mona
It's weird !!. I ran your script with the table...
It's weird !!. I ran your script with the table and column names replaced with valid table and column names in my database. It works perfectly for me.
32,514
Posted By mona
Are these columns code and ctrl_perd valid in...
Are these columns code and ctrl_perd valid in your database? Did you execute these queries in SQL Plus?
31,357
Posted By mona
Did you try this cp file1.txt...
Did you try this

cp file1.txt newDirectory/file1_`date +"%Y%m%d_%H%M"`.txt
26,142
Posted By mona
text deleted.. Sorry.. Understood the...
text deleted..


Sorry.. Understood the requirement wrongly
Showing results 1 to 25 of 96

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