LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to append a string to a file name? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-append-a-string-to-a-file-name-612538/)

anandkj 01-10-2008 03:20 AM

How to append a string to a file name?
 
Hi all,

I have a file named "accesslog". I have another file named "a" which contains a text string, say "Jan-10-14-29-29".

I would like to know how can I append the content of the file "a", that is "Jan-10-14-29-29" to the filename accesslog.

I am expecting an output like : "accesslogJan-10-14-29-29

Tried to do it with tr,sed etc..but couldn't. I am trying to do this within a bash script.

Thanks in advance.
anand

kotnik 01-10-2008 03:41 AM

mv accesslog accesslog.`cat a`

anandkj 01-10-2008 08:10 PM

Thanks
 
Hi kotnik,

Thanks a lot for the reply. It works!

cheers!
anand


All times are GMT -5. The time now is 11:10 AM.