Skip to main content

Hi Team

I am looking for appending date and time timestamp  at end of each file in format <filename>_YYYYMMDDHH24MM.txt

Can someone help me how to achieve it in shell script?

pas per all ways EST, IST timings  etc]

@Priyanka Mynepally 

 

#! /bin/sh
echo "Hello"

str=hello
echo $str
hr = 24
date_now=$(date "+%Y%m%d%H24%M")

echo ${str}__${date_now}.txt
 

Please try this and replace string variable with your filename .


Reply