Hi All, it has been a while i posted here! I need a little modification to a script


Results 1 to 2 of 2

Thread: Hi All, it has been a while i posted here! I need a little modification to a script

  1. #1
    Join Date
    Dec 2002
    Location
    Montreal Canada
    Posts
    383

    Hi All, it has been a while i posted here! I need a little modification to a script

    Hi All, it has been a while i posted here!

    I need a little modification to a script.

    I need this script to change the first letter of each word in a line to (capital letters) if it is not already in capital letter.
    That need to be done before the rest of the script removes the (blank space) as it does nicely.
    Not sure if this is possible.
    Thanks for your help.

    Code:
    #!/bin/bash
    # noblankspace is a script to remove blank space in the name of files.
    # Thxs to Retsaw.
    
    IFS=$'\n';for i in `find /home/normand/Desktop/TEMP -type f`;do dir=`dirname $i`;name=`basename $i|sed "s/ //g"`;mv $i $dir/$name;done;unset IFS
    
    #Obviously, change /path/to/files to where the files you want renamed are located. If you want underscores instead of spaces, change the sed command to:
    #sed "s/ /_/g"

    Linux Counter


    Debian "Lenny"
    Mandriva 2010.2

    "Where am I?" "In the Village." "What do you want?" "Information.""Whose side are you on?" "That would be telling.... We want information. Information! INFORMATION!"

  2. #2
    Join Date
    Dec 2014
    Posts
    8
    Just capitilise all letters that follow a semicolon:

    sed -e 's/;./\U&\E/g'
    Last edited by bestellen; 09-22-2015 at 01:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •