The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-10-2009
amio amio is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 24
Question How to remove a newline character at the end of filename

Hi All,
I have named a file with current date,time and year as follows:

month=`date | awk '{print $2}'`
date=`date | awk '{print $3}'`
year=`date | awk '{print $6}'`
time=`date +%Hh_%Mm_%Ss'`
filename="test_"$month"_"$date"_"$year"_"$time".txt"
> $filename


The file is created with a newline character at the end (after .txt) of the filename. Am not getting why this is happening.. Can u help me??

Thanks,
Amio