Hi,
ls | perl -ne 'print if /\.$/'| sed 's/\(.*\)/mv & \1jpg/' | sh
I concocted the above command to change files named
A1234. to A1234.jpg
Is there a pure perl one-liner for this? Just curious.
Thanx,
Dp.
Dermot wrote:
> Hi,
>
> ls | perl -ne 'print if /\.$/'| sed 's/\(.*\)/mv & \1jpg/' | sh
>
>
> I concocted the above command to change files named
>
> A1234. to A1234.jpg
>
> Is there a pure perl one-liner for this? Just curious.
>
> Thanx,
> Dp.
>
perl -e 'rename $_, $_."jpg" foreach (glob
Dermot wrote:
Hi,
Hello,
ls | perl -ne 'print if /\.$/'| sed 's/\(.*\)/mv & \1jpg/' | sh
I concocted the above command to change files named
A1234. to A1234.jpg
Is there a pure perl one-liner for this? Just curious.
perl -e'rename$_,"${_}jpg"or warn"$_: $!"for<*.>'
John
--
Perl isn'
Chas. Owens wrote:
The XMLin method takes a string, file, or file handle as its argument.
Just pass $upload_filehandle to it:
my $ref = $xs->XMLin($cgi->upload("filename"));
print $xs->XMLout($ref);
Hi
Thanks for replying. To be honest, I did try that, but then i was getting this
message.
On a unix/linux file system you see the following:
$ ls -la
total 244
drwx--9 rcoops ddao24096 Feb 13 09:40 .
drwxr-xr-x 39 root root 4096 Feb 11 13:23 ..
-rw---1 rcoops ddao2 158310 Feb 13 09:40 .bash_history
-rw-r--r--1 rcoops ddao2 2
On Feb 13, 2008 8:34 AM, <[EMAIL PROTECTED]> wrote:
> I've been going over some listings and I found code
>
> like the following:
>
>
>
> "./directory/file.txt" and
>
> "../directory/file.txt"
>
>
>
> but I've never seen the "./" and "../" things at the
>
> beginning of the path. I've tried to goo
I've been going over some listings and I found code
like the following:
"./directory/file.txt" and
"../directory/file.txt"
but I've never seen the "./" and "../" things at the
beginning of the path. I've tried to google these
but had no luck. I've googled "file specification" and
"dire
[EMAIL PROTECTED] told me on 02/13/2008 10:34 AM:
> I've been going over some listings and I found code
>
> like the following:
>
>
>
> "./directory/file.txt" and
>
> "../directory/file.txt"
>
>
>
> but I've never seen the "./" and "../" things at the
>
> beginning of the path. I've trie
On 02/13/2008 11:34:56 AM, [EMAIL PROTECTED] wrote:
-> I've been going over some listings and I found code
->
-> like the following:
->
->
->
-> "./directory/file.txt" and
->
-> "../directory/file.txt"
this is not really a perl question, but since perl does respect the
reference:
"." and ".."
On Feb 13, 2008 12:52 AM, Brent Clark <[EMAIL PROTECTED]> wrote:
> Chas. Owens wrote:
>
> > The XMLin method takes a string, file, or file handle as its argument.
> > Just pass $upload_filehandle to it:
> >
> > my $ref = $xs->XMLin($cgi->upload("filename"));
> > print $xs->XMLout($ref);
>
> Hi
>
>
On Feb 13, 2008 12:30 PM, <[EMAIL PROTECTED]> wrote:
> Thank you to all who replied to this requestnow I
> understand! I appreciate the help and the courtesy
> of the replies! Once againThank You!!
"One more satisfied customer" -said somewhere sometime by merlyn.
--
David Moreno - http
Thank you to all who replied to this requestnow I
understand! I appreciate the help and the courtesy
of the replies! Once againThank You!!
-Original Message-
From: Copits Dick
Sent: Wednesday, February 13, 2008 11:35 AM
To: beginners@perl.org
Subject: Newbie File Question
I'v
> "Robert" == Robert Leibl <[EMAIL PROTECTED]> writes:
Robert> Dermot wrote:
>> Hi,
>>
>> ls | perl -ne 'print if /\.$/'| sed 's/\(.*\)/mv & \1jpg/' | sh
>>
>>
>> I concocted the above command to change files named
>>
>> A1234. to A1234.jpg
>>
>> Is there a pure perl one-liner for this?
On Feb 13, 2008 11:57 AM, ciwei <[EMAIL PROTECTED]> wrote:
> hostA>ls
> SUNWjassVRTSVRTSicsco VRTSvcs
> emc SUNWmlibVRTSalloc VRTSjre VRTSvlicVRTSvxvm
>
> hostA>ls | perl -en 'print if /SUNW/'
>
> return nothing , while
>
> hostA>ls | perl -ne 'print if /SUNW/'
hostA>ls
SUNWjassVRTSVRTSicsco VRTSvcs
emc SUNWmlibVRTSalloc VRTSjre VRTSvlicVRTSvxvm
hostA>ls | perl -en 'print if /SUNW/'
return nothing , while
hostA>ls | perl -ne 'print if /SUNW/'
SUNWits
SUNWjass
SUNWmlib
SUNWrtvc
so why the order of -n -e switch mak
On Feb 13, 2008 2:57 PM, ciwei <[EMAIL PROTECTED]> wrote:
snip
> so why the order of -n -e switch make the differience?
> this is perl 5.8.4.
> Thanks
snip
This is true in all versions of Perl. It is becuase you are allowed
to have more than one -e option:
perl -e 'print "read ";' -e 'print "th
16 matches
Mail list logo