concatenate function in scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramoria
    New Member
    • May 2014
    • 2

    concatenate function in scripts

    Hi im new to unix .i have a file name called www_xxx_zzz.txt but now i have to concatenate yyy along with file name i.e the output of file name should be www_xxx_yyy_zzz .txt can you help me on this using SCRIPTS in unix..
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    In bash*, a possible solution is:
    Code:
    name=www_xxx_zzz.txt
    echo ${name%.txt}_yyy.txt
    *i'm not sure it this works with other shells...

    Comment

    • ramoria
      New Member
      • May 2014
      • 2

      #3
      thanks will try it out

      Comment

      Working...