The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to get file extension shirleyeow Shell Programming and Scripting 17 01-17-2008 08:40 AM
Changing extension mohan705 Shell Programming and Scripting 4 06-30-2007 01:06 PM
Append extension here2learn Shell Programming and Scripting 3 08-12-2004 12:41 PM
how do i change extension kswaraj Shell Programming and Scripting 2 06-28-2004 08:07 PM
How to change extension? prkwan Shell Programming and Scripting 4 11-16-2002 07:14 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-02-2007
adurga adurga is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 19
without extension

Hi,

I need a help regarding a small requirement. I have a list of C files. I need to put them in a file but without .c extension.
say if I have the files as file01.c, file02.c, file03.c etc
My file say cfiles should have
file01
file02
file03
...
...

etc
Appreciate your quick help on this.

Thank you
  #2 (permalink)  
Old 07-02-2007
Shell_Life's Avatar
Shell_Life Shell_Life is offline
Registered User
  
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Code:
ls > All_c_Files
sed 's/.c$//' All_c_Files > $$Temp
mv $$Temp All_c_Files
  #3 (permalink)  
Old 07-02-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,847
Quote:
Originally Posted by adurga View Post
Hi,

I need a help regarding a small requirement. I have a list of C files. I need to put them in a file but without .c extension.
say if I have the files as file01.c, file02.c, file03.c etc
My file say cfiles should have
file01
file02
file03
...
...

etc
[...]
bash/ksh93:

Code:
set -- *.c
printf "%s\n" "${@%.c}"
zsh

Code:
printf "%s\n" *.c(:r)
  #4 (permalink)  
Old 07-02-2007
adurga adurga is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 19
Thanks a lot both of you. It helped.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0