Adding carraige Return at the end of the file

10-11  Source: Network gathering  Views:0 

Advertisement
The following is my Shell script which will transfer the File from one path to another:
The file is having /n(Line Feed) at the end of earch line,but the client required a Carraige Return /r along with Line Feed for all the lines in the Output File.
Please guide me how to add Carraige Return before Line Feed
The following is the Shell Script:
#!/bin/bash
login_usr_pwd=$1
conc_user_id=$2
conc_user_name=$3
requestid=$4
prev_req_id=$5
report_type=$6
batch_name=$7
file_name="o$prev_req_id.out"
echo $report_type
echo $batch_name
echo $file_name
if [ "$report_type" = "EFT" ]
then
file_1="$batch_name.aba"
echo "EFT-----------"
echo $file_1
echo "-----------"
tr -d '<#***#>' < $COMMON_TOP/admin/$APPLOUT/$file_name > $XXAP_TOP/out/"$file_1"
chmod 777 $XXAP_TOP/out/"$file_1"
else
file_1="out_1_$prev_req_id.txt"
echo $file_name
echo $file_1
tr -d '<#***#>' < $COMMON_TOP/admin/$APPLOUT/$file_name > $XXAP_TOP/out/$file_1
chmod 777 $XXAP_TOP/out/$file_1
fi
Best Regards,
Mahi
add chr(10)+chr(13) (dos/windws line ending): unix2dos <file>remove chr(10)+chr(13), make end of line only chr(10): dos2unix <file>
Related articles