09-11-2018
Welcome novilatte,
Sadly I don't know what you are trying to achieve as output here. Can you explain?
Is it homework perhaps? There is a special forum for this.
I could guess that you want a sequence of dates where the month and the day add one each iteration but I'm not sure why.
.... or is it that you want every combination of valid dates for these months. In this case, you are missing the 31st when that occurs and including the 30th February, and taking no account of a leap year.
Would the output from cal be useful?
Can you explain the purpose of this in context? There may be a better way.
Kind regards,
Robin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear Expert,
Is there a command to do that in Unix?
In such a way that we don't need to actually "write" or
modified the content.
-- monkfan (4 Replies)
Discussion started by: monkfan
4 Replies
2. Shell Programming and Scripting
I am working on a script that checks two arguments at the command line. The first argument is a search pattern, the second can be a file or a directory, if it is a file a second script is called that checks it for the search pattern. If the second argument is a directory, it checks for the search... (5 Replies)
Discussion started by: Breakology
5 Replies
3. Shell Programming and Scripting
I need some help recovering from a "slight" screwup. We just moved 3 TB of data from one RAID Array to another. Low lever archive files. This was done with a regular cp (for some reason) and now we have lost all the timestamps on the files, and we urgently need to get the timestamps back on these... (7 Replies)
Discussion started by: chj
7 Replies
4. Shell Programming and Scripting
How can I change the cron entries only for ABC and XYZ from dosomething_1.0.sh to nowchanged_2.0 using a bash script ?
Any help will be appreciated.
#
# ABC
00,05,10,15,20,25,30,35,40,45,50,55 * * * * /mydir/dosomething_1.0.sh 1>/dev/null 2>&1
#
#
##
# DEF... (4 Replies)
Discussion started by: jville
4 Replies
5. Shell Programming and Scripting
Hi,
I run a script which outputs various records, anyway one of the columns contains the date in the format DDMMYYYY, I would like to make this DDMMYY.
Is there an easy way to do this, (11 Replies)
Discussion started by: mcclunyboy
11 Replies
6. UNIX for Dummies Questions & Answers
Hi Experts,
We get "Day" of a month in a variable, so how to make date of out it?
To make more sense
if my variable $DAY contains "12" and month and year will be current date (as of today)
so I want to see as output as 2013-09-12.
How can I achive this bash script??
Any help is... (4 Replies)
Discussion started by: parpaa
4 Replies
7. Shell Programming and Scripting
Hello Guys
I have a script working fine on csh, but I would like to change it to bash, how I should change this command to be able to work as bash script. :wall:
if ( $fsw > "0" ) then
foreach swath ( `awk 'BEGIN {for (i='$fsw';i<='$lsw';i++) printf ("%s\n", i) }'` )
## work to be done... (2 Replies)
Discussion started by: jiam912
2 Replies
8. UNIX for Beginners Questions & Answers
#!/bin/bash
X=$(</home/cogiz/computerhand.txt) # (3S 8C 2H 6D QC 8S 4H 5H)
Y=$(</home/cogiz/topcardinplay.txt) # KS
A=( "${Y::1}" )
B=( "${Y:1}" )
for e in ${X}; do
if ]; then # searching for valid cards K,S or 8
... (0 Replies)
Discussion started by: cogiz
0 Replies
9. UNIX for Beginners Questions & Answers
I'm trying to change date format using this script from day/month/year to month/day/year
#!/bin/bash
while read line; do
echo "$line"
date=$(echo "$line" | cut -d/ -f1 )
month=$(echo "$line" | cut -d/ -f2 )
echo $month"/"$date"/2017"
done < ~/Downloads/Dates.csv
But I get output as... (5 Replies)
Discussion started by: sharat
5 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I have a CSV file which is as below. Basically I need to take the year column in it and find if the year is >= 20152 . If that is then I should subtract all values by 6. In the below example in description I am having number mentioned as YYWW so I need to subtract those by -5. Whereever... (8 Replies)
Discussion started by: arunkumar_mca
8 Replies