Search Results

Search: Posts Made By: crumb
6,678
Posted By crumb
That works perfect guy. I think that may be the...
That works perfect guy. I think that may be the winner. I had to install ksh but that works for me. I don't have to make changes to the spaces either.

Thanks

ps... the character string i need...
6,678
Posted By crumb
I think the egrep is also separating everything...
I think the egrep is also separating everything at the space too.

---------- Post updated at 12:38 AM ---------- Previous update was at 12:35 AM ----------

I would also be ok removing all the...
6,678
Posted By crumb
I just tried it on my actual files and realized...
I just tried it on my actual files and realized there are spaces involved. This seems to throw a wrench into what has been already used.
Any more ideas?
6,678
Posted By crumb
Cool. That did it. Here is my pseudo-final...
Cool. That did it. Here is my pseudo-final solution: -also not pretty but does the job.
#! /bin/bash

for OLD_FILE in $( ls | egrep '^[[:alnum:]][[:alnum:]][[:alnum:]][[:alnum:]][[:alnum:]]' )
do...
6,678
Posted By crumb
I added the echo so if anything haywire happens...
I added the echo so if anything haywire happens then I don't mess stuff up. The echo shows the same filename, one after the other.
Is the 'sed' code correct? Am I doing something wrong?
6,678
Posted By crumb
Thanks for the response. I tried a test case with...
Thanks for the response. I tried a test case with the code you gave and the filenames don't change.
#! /bin/bash

for OLD_FILE in $( ls | egrep '^[0-9]{5}' )
do
NEW_FILE=$( echo ${OLD_FILE} |...
6,678
Posted By crumb
Change all filenames in a directory
I have a directory of files and each file has a random 5 digit string at the beginning that needs to be removed. Plus, there are some files that will be identically named after the 5 digit string is...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy