10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello.
I can use any particular (stupid or not) format when using bash date command.
Example :
~> date --date "now" '+%Y-%m-%d %H!%M!%S'
2019-06-03 12!55!33or
~> date --date "now" '+%Y£%m£%d %H¤%M¤%S'
2019£06£03 12¤57¤36
or
~> date --date "now" '+%Y-%m-%d %H-%M-%S'
2019-06-03 12-58-51
... (4 Replies)
Discussion started by: jcdole
4 Replies
2. Shell Programming and Scripting
i try to set linux date & time in specific format but it keep giving me error
Example :
date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
or
date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
keep giving me this error :
date: invalid date ‘19-01-2017 00:05:01'
Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies
3. UNIX for Advanced & Expert Users
Hi, I have a function to calculate "yesterday" in format YYYYMMDD:
desa_ev9 # date +"%Y%m%d" --date "-1 day 20180701"
20180630
desa_ev9 # date +"%Y%m%d" --date "-1 day 20180720"
20180719
desa_ev9 # date +"%Y%m%d" --date "-1 day 20190101"
20181231
desa_ev9 # date +"%Y%m%d" --date "-1... (2 Replies)
Discussion started by: augreen
2 Replies
4. Shell Programming and Scripting
My question is how would i loop a read command to keep asking the user for input and eventually print the no. of valid invalid inputs after a specified control input typed i.e. (-3). (1 Reply)
Discussion started by: Flowoftruth
1 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I am a newbie...I would like to have a function which ll check if a file contains valid strings before "=" operator. Just to give you my requirement:
assume my file has content:
hello= gsdgsd sfdsg sgdsg sgdgdg
world= gggg hhhh iiiii
xxxx= pppp ppppp pppp
my... (5 Replies)
Discussion started by: rtagarra
5 Replies
6. Shell Programming and Scripting
Hi All,
I am trying to convert the date of all files under a directory in seconds,
PFB script
a=`ls -lrt | wc -l`
echo $a
for ((i=1;i<=$a;i++))
do
A=`ls -lrt | awk '{print $6,$7,$8}' | head -$i | tail -1`
echo ${A}
date -d '${A}' +%s
donebut I am getting error
date: invalid date... (1 Reply)
Discussion started by: Jcpratap
1 Replies
7. Shell Programming and Scripting
File contian below data...
20111101
20111102
20111131
I am new to unix and per scirpt...
First two records are valid and last record is invalid,how to get the valid records...
Please help me unix or perl script.
:wall:
Thanks,
Murali (5 Replies)
Discussion started by: muralikri
5 Replies
8. Shell Programming and Scripting
Hi,
I am passing date string of format 'YYYYMMDD' to a ksh script.
Will I be able to get next valid date from the passed in string.
Example I pass '20100228' to the shell script, Is there a reverse date command to get '20100301' .i.e to convert '20100228' to date and get next date.... (5 Replies)
Discussion started by: bittoo
5 Replies
9. Shell Programming and Scripting
why
date -d "19010101" gets error " date: invalid date `19010101' "
but
date -d "19020101" is fine?
Any approach to fix that?
Thank you. (8 Replies)
Discussion started by: freizl
8 Replies
10. Shell Programming and Scripting
Hi,
I have a 5 gig file, no record terminators, field terminators are newline. The record length is 768 and I would like to check that every 768th byte is a newline and print out the byte position if it isn't. I would like to do this going either forward or backwards with one command if... (3 Replies)
Discussion started by: vtischuk@yahoo.
3 Replies