In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>for file in `ls -1`; do
> newfile=`echo "$file" | sed 's/ /_/'`
> echo "File is named ${file}"
> echo "The new file is named ${newfile}"
>
> mv "$file" "$newfile"
>done
>
>IHMO in the main-loop it is better to choose "ls -1", so the
On Sun, 23 Feb 2003, Theo. Sean Schulze wrote:
> On Fri, Feb 21, 2003 at 09:59:37AM +0100, J. hunted and pecked out:
> [snip]
> >
> > BTW,
> >
> > please remember that `blank' is a GNU extension, regarding portability
> > issues.. etc..
> >
> > ~$ man isblank
> >
> This shouldn't be a problem,
On Fri, Feb 21, 2003 at 09:59:37AM +0100, J. hunted and pecked out:
[snip]
>
> BTW,
>
> please remember that `blank' is a GNU extension, regarding portability
> issues.. etc..
>
> ~$ man isblank
>
This shouldn't be a problem, since I will only be using it on GNU/Linux. Also,
[:blank:] is a ch
On Thu, 20 Feb 2003, Theo. Sean Schulze wrote:
> J.,
>
> Thanks for your suggestions. While googling comp.unix.shell today, I found yet
>another method. I was not aware that "*" when used by itself matches every filename
>in a directory. Apparently, part of the problem I was having was a sid
On Thu, 20 Feb 2003, Theo. Sean Schulze wrote:
> J.,
>
> Thanks for your suggestions.
No problemo,
btw: 4 out of 5 pages on teamfinders.org are generating http 404 not found
messages. I think you should have a critical look at all the http links in
the main page.
J.
-
To unsubscribe from t
J.,
Thanks for your suggestions. While googling comp.unix.shell today, I found yet
another method. I was not aware that "*" when used by itself matches every filename
in a directory. Apparently, part of the problem I was having was a side effect of ls
and find. Here is the script that I use
On Tue, 18 Feb 2003, Theo. Sean Schulze wrote:
> Thanks, that did help, although it didn't solve the problem.
> I now recognize that the problem is in assigning the variable.
> Both my version with ls and the version with find in the example give
> the expected results when printing to the con
Thanks, that did help, although it didn't solve the problem. I now recognize that the
problem is in assigning the variable. Both my version with ls and the version with
find in the example give the expected results when printing to the console, but they
both fail when used to assign a string i
[EMAIL PROTECTED] wrote:
A solution should look like this:
for file in `ls -1`; do
newfile=`echo "$file" | sed 's/ /_/'`
echo "File is named ${file}"
echo "The new file is named ${newfile}"
mv "$file" "$newfile"
done
IHMO in the main-loop it is better to choose "ls -1", so the field
se
> I am trying to write a bash shell script that
> will translate spaces in file names into
> underline characters. This is the script as I
> have it now:
>
> for file in `ls`
> do
> echo $file
> newfile=`ls ${file} | tr '[:space:]' '[_*]'`
> echo File is named ${file}
> echo The new file is n
You can try to adapt this example from The Advanced Bash Scripting Guide:
http://www.tldp.org/LDP/abs/html/moreadv.html#EX57
It deletes the file, but it shouldn't be too hard to adapt to your needs.
--Brian
On Monday 17 February 2003 01:11 pm, Theo. Sean Schulze wrote:
> Hello,
>
> I am trying t
Hello,
I am trying to write a bash shell script that will translate spaces in file names into
underline characters. This is the script as I have it now:
for file in `ls`
do
echo $file
newfile=`ls ${file} | tr '[:space:]' '[_*]'`
echo File is named ${file}
echo T
12 matches
Mail list logo