05-02-2019
I will move the all files to unix sever before manipulating the file name . It my mistake giving wrong path there.
My apologies for that..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I am newbie and hope that you can help me to rename a file
If I have a file name Perform.01222006.12345.Log now I would like to backup another file with another name like perform-20060112.dat
This is a flat file, and I want to collect some field, then put it in a new file from... (9 Replies)
Discussion started by: sabercats
9 Replies
2. UNIX for Dummies Questions & Answers
In C Shell programming I haven't successfully been able to append the date in the format mmddyyyy to a filename. I've tried the following:
I can print out the date in the correct format: date +%x | sed ‘s/\///g
I can create a variable with the filename: set newfile=changedfiles
I can... (3 Replies)
Discussion started by: gigigi
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
Plz suggest me how can i change the date of a file.
Suppose my file has been created in some date and i want to give it present date.
How can i do this???? (2 Replies)
Discussion started by: adityam
2 Replies
4. Shell Programming and Scripting
Hi all,
I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date.
So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
Discussion started by: Donkey25
4 Replies
5. AIX
Hello to all.
I work at AIX system without perl installed and I am restricted user, so I am limited to bash. In script that I am writing, I have to read line from file and transform date that I found inside to Unix timestamp. Line in file look something like this:
Tue Mar 29 06:59:00... (5 Replies)
Discussion started by: Hyperborejac
5 Replies
6. Shell Programming and Scripting
i would like to know how to append current date in a filename with .tgz extension.
#!/usr/bin/perl
my $date = `date + %Y%m%d`;
system("sudo mv /tmp/nyucs01_config_backup.tgz /misc/nyucs01_config_backup_$date.tgz");
im getting this error message:
sh: line 1: .tgz: command not found (7 Replies)
Discussion started by: linuxgeek
7 Replies
7. Shell Programming and Scripting
I have multiple txt files which begin with the word "orders" in folder C:\source. I need to move the files to folder C:\dest and rename them to "process_<date>_<count>"
So for example , if there are 3 files ordersa.txt , ordersb.txt and ordersc.txt in C:\source , after running the script I want... (1 Reply)
Discussion started by: johannd
1 Replies
8. UNIX for Dummies Questions & Answers
I have multiple txt files which begin with the word "orders" in folder C:\source. I need to move the files to folder C:\dest and rename them to "process_<date>_<count>"
So for example , if there are 3 files ordersa.txt , ordersb.txt and ordersc.txt in C:\source , after running the script I want... (7 Replies)
Discussion started by: johannd
7 Replies
9. UNIX for Dummies Questions & Answers
Hi
i want to list files based on date and change the date alone in the files in a directory
abc20120101.txt
xyzxyxz20120101.txt
ccc20120201.txt
ddd20120301.txt
In the above i want to select only files having date 20120101 and rename the date for those files like below
abc20111231.txt... (3 Replies)
Discussion started by: Dewdrop
3 Replies
10. Shell Programming and Scripting
I have a file hello.txt which was created today (today's date timestamp)
I wish to change its date timestamp (access, modified, created) to 1 week old i.e one week from now.
uname -a
SunOS mymac 5.11 11.2 sun4v sparc sun4v
Can you please suggest a easy way to do that ? (12 Replies)
Discussion started by: mohtashims
12 Replies
LEARN ABOUT SUSE
pdl::tips
TIPS(1) User Contributed Perl Documentation TIPS(1)
NAME
PDL::Tips - Small tidbits of useful arcana. Programming tidbits and such.
SYNOPSIS
use PDL;
# Whatever happens here.
DESCRIPTION
This page documents useful idioms, helpful hints and tips for using Perl Data Language v2.0.
Help
Use "help help" within perldl or the "pdldoc" program from the command line for access to the PerlDL documentation. HTML versions of the
pages should also be present, in the HtmlDocs/PDL directory of the PDL distribution. To find this directory, try the following
perldl> foreach ( map{"$_/PDL/HtmlDocs"}@INC ) { p "$_
" if -d $_ }
Indexing idioms
The following code normalizes a bunch of vectors in $a. This works regardless of the dimensionality of $a.
$a /= $a->sumover->dummy(0);
What is actually happening?
If you want to see what the code is actually doing, try the command
PDL::Core::set_debugging(1);
somewhere. This spews out a huge amount of debug info for PDL into STDOUT. It is planned to eventually make this redirectable and the
messages selectable more accurately.
Many of the messages come from "Basic/Core/pdlapi.c" and you can look at the source to see what is going on.
If you have any extra time to work on these mechanisms, infrom the pdl-porters mailing list.
Memory savings
If you are running recursively something that selects certain indices of a large piddle, like
while(1) {
$inds = where($a>0);
$a = $a->index($inds);
$b = $b->index($inds);
func($b,$a);
}
If you are not writing to $b, it saves a lot of memory to change this to
$b = $b->index($inds)->sever;
The new method "sever" is a causes the write-back relation to be forgotten. It is like copy except it changes the original piddle and
returns it).
Of course, the probably best way to do the above is
$inds = xvals ($a->long);
while(1) {
$inds0 = where($a>0);
$inds1 = $inds->index($inds)->sever;
$a = $a0->index($inds1);
$b = $b->index($inds1)->sever;
func($b,$a);
}
which doesn't save all the temporary instances of $a in memory. See "mandel.pl" in the Demos subdirectory of the PerlDL distribution for
an example.
PP speed
If you really want to write speedy PP code, the first thing you need to do is to make sure that your C compiler is allowed to do the
necessary optimizations.
What this means is that you have to allow as many variables as possible to go into registers:
loop(a) %{
$a() += $COMP(foo_member) * $b()
%}
expands to
for(i=0; i<10000; i++) {
a[i] += __privtrans->foo_member * b[i];
}
is about the worst you can do, since your C compiler is not allowed to assume that "a" doesn't clobber "foo_member" which completely
inhibits vectorization. Instead, do
float foo = $COMP(foo_member);
loop(a) %{
$a() += foo * $b();
%}
This is not a restriction caused by PP but by ANSI C semantics. Of course, we could copy the struct into local varibles and back but that
could cause very strange things sometimes.
There are many other issues on organizing loops.
We are currently planning to make PP able to do fixed-width things as well as physical piddles (where looping over the first dimensions
would be cheaper as there are less distinct increments, which might make a difference on machines with a small number of registers).
AUTHOR
Copyright (C) Tuomas J. Lukka 1997. All rights reserved. Duplication in the same form and printing a copy for yourself allowed.
perl v5.12.1 2009-10-17 TIPS(1)