Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I really enjoy your site. You have a lot of helpful and friendly experts who contribute so willingly. Thank you for past (and future) technical advice..."

Geography

Where in the world do Tek-Tips members come from?

KORN Remove PID from FIlenameHelpful Member!(2) 

awood69 (Programmer)
25 Apr 12 10:59
I have a file name like this

    report_name.xml.12345

where the 12345 was added by using the $$

I need to remove the
     .12345 from the end of the filename before I email it out.

Thanks in advance.
Helpful Member!  feherke (Programmer)
25 Apr 12 11:02
Hi

CODE --> MKsh

master # name='report_name.xml.12345'
master # echo "${name%.*}"           
report_name.xml

Feherke.
http://feherke.github.com/

awood69 (Programmer)
25 Apr 12 11:18
Is there a way to do it without using the " * "?
feherke (Programmer)
25 Apr 12 11:26
Hi

Why ?

CODE --> MKsh

master # name='report_name.xml.12345'
master # echo "${name%.+([0-9])}"
report_name.xml

Feherke.
http://feherke.github.com/

awood69 (Programmer)
25 Apr 12 11:34
Very cool thanks a lot!
SamBones (Programmer)
25 Apr 12 13:59
A star for feherke's reply.

bigsmile

 
FlorianAwk (Programmer)
27 Apr 12 12:52
Is there somewhere any documentation about this powerfull syntax?
Helpful Member!  feherke (Programmer)
27 Apr 12 13:01

Quote (FlorianAwk):

Is there somewhere any documentation about this powerfull syntax?
See the man ksh :

Feherke.
http://feherke.github.com/

FlorianAwk (Programmer)
27 Apr 12 13:43
Thank you very much.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close