![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2007
Posts: 17
Rep Power: 0
![]() |
I have written a file rename
, however my code was suppose to check the input and output of the particular files being held. Also, I have written a second code that deletes the files that haven't been used in a while on a given directory. However, I thought my codes but I would like to know where I have messed up. Inquiring minds would like to know. Thanks!#!/bin/bash files=$(ls -1 | grep .mp3) for x in $files do mv $x band_song$x done #!/bin/bash
for X in *.html
do
rm "$X";
done |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
Re: Bash File Rename and Deletion
I haven't ever seen a single line of Bash before, but since you PM'd me, I'll give it a shot.
If you are trying to rename all of the mp3s to have the prefix "band_song", then I would have to guess this. This is a total shot in the dark though... #!/bin/bash
for x in *.mp3
do
mv "$x" "band_song$x";
doneUnless your script already worked, and you were trying to "check the input". Which you'll need to be more specific about. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Oct 2007
Posts: 17
Rep Power: 0
![]() |
Re: Bash File Rename and Deletion
I have tried that method and apparently it doesn't work.
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|