#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2014
    Posts
    1
    Rep Power
    0

    Lightbulb new line character issue in file names


    Good Day,

    I am a newbie to shell scripting. I have developed a shell script wherein I am accepting a parameter which has file name. To this file name, I want to append few characters in the beginning and at the end.

    To achieve this requirement, I have written the below code:-

    v1=$6
    #$6 is the parameter which will have file name. The file name passed is 12344
    v=o${v1}.out
    #appending characters in the beginning and at the end
    echo "v=$v"

    I am expecting the output as o12344.out

    But the output is shown as:-
    o12344
    .out

    Basically the issue all the characters I am appending in the end are displaying in new line.

    Can any one please help me in fixing this issue?

    Many thanks in advance.

    Regards,
    Vickey.
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    867
    Rep Power
    391

    Talking


    Try:
    Code:
    v="o${v1}.out"

IMN logo majestic logo threadwatch logo seochat tools logo