10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to create a shell script to create a folder by using the today's date to take backup using rsync command on every evening around 7 pm.
Kindly help.
Thanks.
To be more precise,
I want to create a script which matches the today's date with server's date format, if matches then creates the... (2 Replies)
Discussion started by: bakula10
2 Replies
2. HP-UX
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
3. Shell Programming and Scripting
Hello,
I have this unix script which selects rows from DB where current time is greater than expired time (column). So this will give all the records that are expired 1 day ago, 2 days ago, 3 days ago, etc.. I need help modifying in such that it should give records that are only expired 1 day... (5 Replies)
Discussion started by: jakSun8
5 Replies
4. UNIX for Dummies Questions & Answers
Hello, I am using ksh93 (/usr/dt/bin/dtksh) on Solaris and am stuck when trying to use find with the -prune option.
I need to search a directory (supplied in a variable) for files matching a certain pattern, but ignore any sub-directories.
I have tried:
find ${full_path_to_dir_to_search}... (9 Replies)
Discussion started by: gary_w
9 Replies
5. Shell Programming and Scripting
Hi all,
I am trying to execute the following command in a sun solaris machine and getting the error as below.
bash-2.03$ date -d "1 day ago" +%Y%m%d
date: illegal option -- d
bash-2.03$ uname -a
SunOS gtrd02 5.8 Generic_117350-55 sun4u sparc SUNW,Sun-Fire-V440
Can anybody help me to... (1 Reply)
Discussion started by: Tuxidow
1 Replies
6. Shell Programming and Scripting
hello. i have a script, but in solaris i get this message sed: illegal option -- i
whats wrong? With Ubuntu there is no problem. Thanks for help.
#!/bin/bash
for file in $(find /directory..../Test/*.txt -type f)
do
head -n 1 $file | egrep '^#!'
if
then
sed -i '2i\Headertext'... (3 Replies)
Discussion started by: fertchen
3 Replies
7. Solaris
Hi All,
Is it possible to run date -d option in Solaris?
Do we have a work around so that -d option will be recognized
by solaris as it is recognized by linux.
I need this since i am using this in scripting and it works in Linux box. my problem is
it doesn't work in solaris box.
... (6 Replies)
Discussion started by: linuxgeek
6 Replies
8. UNIX for Dummies Questions & Answers
How can i assign a variable by the name of CUTDATE= today date - 90 days? i have something like this right now :-
today=`date '+%Y%m%d'`
#cutdate = this is where i am having problem. i need today - 90 days
How can i accomplish this? After that i need to do delete the data which are more... (16 Replies)
Discussion started by: chris1234
16 Replies
9. Shell Programming and Scripting
Hi
I get problems when using the following command :
cat logs | awk -F";" '{ system("date -d "1970-01-01 UTC+0100 $1 seconds""); }'
date: date invalide `1968641199401200'
date: date invalide `1968641199381709'
this is what i have in my log file :
cat logs
1199401200;a... (3 Replies)
Discussion started by: arag0rn
3 Replies
10. Shell Programming and Scripting
Hi,
I am facing one problem with date command.Actually I want to use this command to get the last month,not the current month..OK,I can do current month - 1 and give special condition for january,But this time i need last month as strings like January,februaury,march etc...
There is option... (5 Replies)
Discussion started by: nikunj
5 Replies