![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| problem with output of find command being input to basename command... | new_learner | UNIX for Dummies Questions & Answers | 2 | 12-14-2008 02:56 AM |
| awk/sed Command : Parse parameter file / send the lines to the ksh export command | rajan_san | Shell Programming and Scripting | 4 | 11-06-2008 01:29 PM |
| assign a command line argument and a unix command to awk variables | sweta_doshi | Shell Programming and Scripting | 0 | 08-08-2008 07:54 AM |
| Help Required: Command to find IP address and command executed of a user | loggedout | Security | 2 | 08-06-2008 09:12 PM |
| inconsistent ls command display at the command prompt & running as a cron job | rajranibl | SuSE | 5 | 07-30-2007 09:26 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
using cut command
I am new to unix ... I have a file with name unixile.123761 I need to cut the extension from this file name? can u help me for this
i have tried like follows copied the file lo one variable v and then `echo $v | grep cut -d = -f 1` |
|
||||
|
Those commands are used to split strings of characters into pieces.
You can also use cut, but it will have problems with a filename like mytarball.tar.gz This page explains how to play with strings in bash (ksh has the same {} syntax for %, %%, #, and ##) Manipulating Strings |
|
||||
|
for a in `ls`; do if [ $a != ${a%.*} ] ; then mv $a ${a%.*}; fi; done
write this in the shell when you are positioned in the directory where you want to make the changes; note that the command {a%.*} is non-greedy - that is the file 'this.is.my.file' will be renamed 'this.is.my', not just 'this' |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|