![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| back to back printing in UNIX | amirthraj_12 | AIX | 3 | 05-06-2008 04:42 AM |
| Back-to-Back Connection using HBAs | aldowsary | IP Networking | 2 | 11-12-2007 03:43 PM |
| How to print two sql query outputs side by side in excel | prasee | Shell Programming and Scripting | 6 | 09-07-2007 11:20 PM |
| File to Array and Back. | Boucho | High Level Programming | 1 | 02-14-2006 08:32 AM |
| Having a Unix system installed side to side with Windows? | Pcslider | UNIX for Dummies Questions & Answers | 14 | 01-29-2002 03:21 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
How to cut a file name from back side
Hi
I have to delete 18 characters from my file names from back side. i mean if file name is abcde123456 then i have to delete 6 characters from back and i need file name as abcde. Please help |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
file=abcdefg123456
newfile=${var%??????}
echo $newfile
abcdefg
namish |
|
#3
|
|||
|
|||
|
with sed
Code:
sed 's/.\{6\}$//g'
|
|
#4
|
|||
|
|||
|
If you have GNU cut
Code:
echo abcde123456 | cut -c6- --complement |
|
#5
|
|||
|
|||
|
it worked...
thank you so much |
|||
| Google The UNIX and Linux Forums |