Search Results

Search: Posts Made By: targzeta
Forum: Programming 11-09-2013
3,129
Posted By targzeta
Have you already seen the getwchar() function?...
Have you already seen the getwchar() function? getc() like getchar() reads only one byte at time so fails with UTF8.

Emanuele
Forum: Programming 10-29-2013
4,689
Posted By targzeta
Basically os.walk...
Basically os.walk (http://docs.python.org/2/library/os.html#os.walk) returns a tuple (dirpath, dirnames, filenames). So, if you want the full path of every files, you have to join dirpath and...
22,217
Posted By targzeta
sed -n "s/.*/'&'/;1{h;d};H;\${x;s/\n/,/g;p;q}"...
sed -n "s/.*/'&'/;1{h;d};H;\${x;s/\n/,/g;p;q}" code_LIST.txtEmanuele
Forum: Slackware 10-28-2013
12,069
Posted By targzeta
Yes. I use Slackware on all my PC. Emanuele
Yes. I use Slackware on all my PC.

Emanuele
1,272
Posted By targzeta
cat list.txt | while read pattern; do find...
cat list.txt | while read pattern; do find sourcedir -name "*$pattern*" -exec mv '{}' destdir/ \;;doneEmanuele
8,716
Posted By targzeta
@Scrutinizer, @Don Cragun and @alister. You have...
@Scrutinizer, @Don Cragun and @alister. You have reason.$> strace sed -ni '2,$p' file
....
open("file", O_RDONLY) = 3
...
open("./sedvS2Dny", O_RDWR|O_CREAT|O_EXCL, 0600) = 4...
8,716
Posted By targzeta
From sed(1):-i[SUFFIX], --in-place[=SUFFIX] ...
From sed(1):-i[SUFFIX], --in-place[=SUFFIX]

edit files in place (makes backup if SUFFIX supplied)Emanuele
8,716
Posted By targzeta
Bash:n=50000; start=$(( $(wc -l file | cut -d' '...
Bash:n=50000; start=$(( $(wc -l file | cut -d' ' -f1) - $n + 1 )); sed -ni ${start},\$p fileEmanuele
26,443
Posted By targzeta
I think the problem is with daylight saving time....
I think the problem is with daylight saving time. But, see this:# 1) correct
$> perl date.pl -d 'now + 3 days'
2013-10-28 23:24:14
$> date -d 'now + 3 days'
Mon Oct 28 23:24:20 CET 2013

#2)...
26,443
Posted By targzeta
Ok, I'm using Linux Slackware64 but...perl...
Ok, I'm using Linux Slackware64 but...perl date.pl
Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /usr/local/lib64/perl5
/usr/local/share/perl5...
3,180
Posted By targzeta
Wath about the simpler:du /usr/ | sort -nr | head...
Wath about the simpler:du /usr/ | sort -nr | head -n11 | tail -n10 | while read size path; do echo $path $size;doneEmanuele

P.S. If you want consider also /usr dir (that obviously is the first...
7,846
Posted By targzeta
Ok, thank you. Emanuele
Ok, thank you.

Emanuele
7,846
Posted By targzeta
Is there a good reason for that? Emanuele
Is there a good reason for that?

Emanuele
7,846
Posted By targzeta
for emp_no in $(<file) do echo "select *...
for emp_no in $(<file)
do
echo "select * from emptab where emp_no=${emp_no}"
done > query.sql

Emanuel
Forum: Open Source 10-21-2013
359,795
Posted By targzeta
Emacs Emanuele
Emacs

Emanuele
1,972
Posted By targzeta
sed 's;</\?load>[[:space:]]*;;g'...
sed 's;</\?load>[[:space:]]*;;g' fileEmanuele
1,972
Posted By targzeta
sed 's;</\?load>;;g' fileEmanuele
sed 's;</\?load>;;g' fileEmanuele
8,167
Posted By targzeta
$> tar -tf filename.tar file1 file2 file3 ...
$> tar -tf filename.tar
file1
file2
file3
$> mkdir dir
$> tar -C dir/ -xf filename.tar file1
$> ls dir/
file1Different version?$> tar --version
tar (GNU tar) 1.26
...
8,167
Posted By targzeta
This works fine for me:tar -C dir -xf...
This works fine for me:tar -C dir -xf filename.tar file.txt
Emanuele
1,419
Posted By targzeta
I'm supposing that the latest two digits...
I'm supposing that the latest two digits rapresents the hour.

In bash:date1='2013101511'
date2='2013101812'
ts_date1=$(date --date="${date1:0:8} ${date1:8}" '+%s')
ts_date2=$(date...
1,693
Posted By targzeta
Ok, then:egrep '^\\rtf1.*fs(16|20)$'"starts with...
Ok, then:egrep '^\\rtf1.*fs(16|20)$'"starts with \rtf1" -> '^\\rtf1'
"ends with fs16 or fs20" -> 'fs(16|20)$'
"any characters in between" -> '.*'

Emanuele
3,241
Posted By targzeta
from time import strptime, strftime date_in...
from time import strptime, strftime

date_in = '10/16/2013'

date_out = strftime('%Y-%m-%d', strptime(date_in, '%m/%d/%Y'))

print date_out

Emanuele
13,564
Posted By targzeta
@Scrutinizer ok, thank you. Emanuele
@Scrutinizer ok, thank you.

Emanuele
1,693
Posted By targzeta
For single line matching:egrep...
For single line matching:egrep '^\\rtf1.*\\f0\\fs(16|20)$'
We have to use extended regexp.

Emanuele
13,564
Posted By targzeta
What about:date --date='now - 5 days'? ...
What about:date --date='now - 5 days'?

Emanuele
Showing results 1 to 25 of 26

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