Programming :: How To Print Out "n" Days Ago's Year / Month And Day
Feb 10, 2011Interesting uh? For example, 2 days ago's date is 2011 Feb 8th. This is not a homework...
View 3 RepliesInteresting uh? For example, 2 days ago's date is 2011 Feb 8th. This is not a homework...
View 3 RepliesDoes anybody know where the "pay-per-year-instead-of-per-month-botton" is located. I can't find it
View 2 Replies View RelatedI use an email program that shows the date as, 10-4-26.....which means the year 2010 (10) April (4) 26th day.
How do I change the date format so that it's- Month-Day-Year?
I want this changed system wide so all dates are shown in the format I want.
on the mac there is a piece of software to change the system clock so it shows the stardate instead of the month, day and year. Is there something like that for Ubuntu? I think it would be pretty cool to have a star trek themed desktop
View 9 Replies View Relatedhow i can use the cal command so it displays the current month and the next month, i know you can use cal -3 9 2007 to show the previous current and next but i just want to display the current and next.
View 9 Replies View RelatedI'm looking for a powerful network traffic monitor that can do all of the following (or at least a combination of tools that can do the following):
Tell me how much data was downloaded/uploaded on an interface this month and the previous month tell me how the traffic was used throughout the monthshow which internal IPs (IPs in the 192.168.1.0/24 network) used how much traffic show which ports/protocols on those IPs used all that traffic
Hhow LIVE traffic flow statistics that can tell me total speed of traffic going through an interface as well asshow which internal IPs (IPs in the 192.168.1.0/24 network) are using how much of the traffic show which ports/protocols on those IPs are using that traffic
This tool will run on a linux router through which all my internal PCs are connected to the Internet. This means the tool(s) need to work with NAT (traffic being forwarded and not necessarily destined for the interfaced being monitored).
The distribution being run doesn't have a package manager so any packages or dependencies have to be manually compiled and SCPed over file by file. For this reason, the tool/tools need to be simple (things like vnstat, not things like ntop that have their own web interface).
I know that vnstat can tell me the first bullet point so it's only there incase there's a tool out there that can do everything. If there's a tool that can only do the second or third bullet point, that's great too - I'll just keep using vnstat and look for something else to do the other task.
I have a script: Code: #!/bin/bash
THEYEAR=2011
LASTYEAR=$(($THEYEAR - 1))
echo $THEYEAR
echo $LASTYEAR I get:
[Code]...
THEYEAR is correct but then I get a line space and then a -1 for LASTYEAR. I can't figure out why.
In the MySQL database for one of my programming projects, I used a "YEAR(4)", because I wanted the column to contain four-digit year values. I discovered, though, that this type only allows values from 1901 to 2155, which is not workable as some year values are previous to the twentieth century. But I do not want a "DATE" type because the month and day are of no interest to me. What type should I convert to that would be the least radical change in data type, while giving more range?
View 1 Replies View RelatedI have a folder of 2 many files that the old ls just hangs.
I am trying to write some log files such as;
I don't mind doing one at a time, but I am just playing and even getting the listing I am not getting the date stamp, I have the following;
That does create the file, but all the files look like this;
So basically it's just sticking that ls inside the log file and not actually running the ls, so how can I use the above type to get files just created per year?
I am new to unix, I am looking for a script to delete files older than 7 days but i also want to exclude certain directories (like arch,log .....) and also some files with extensions ike .ksh, .ch, ..............) in directories and sub directories
View 4 Replies View Relatedis there a way for me to grep the process that running more than 30 days only using linux command or script?
example:i do ps -ef to list out the process, then i want to filter only the process that always running more than 30 days..
Is there any way a non-root user can programmatically determine which days the computer ran during, say, the last month?
The information is in /var/log/messages.* but those files are root:root 640.
Non of the world-readable /var/log files on the Slackware 13.0 development system can be used:boot Not present if boot logging not enabled (default). dmesg No timestamps. lastlog Not enough info. wtmp Rewritten on each boot so not enough info. EDIT: not correct: by default wtmp is rotated weekly and kept for one month as configured in /etc/logrotate.conf xdm.log Not present if xdm not used. Xorg.0.log Not present if X not run.
I got this part from my script working that it will delete a folder is from 8 days agoEightDaysAgo=`(date --date="8 days ago" +%d-%m-%Y)`rm -rf $EightDaysAgoTarHowever I need to remove files that are older than 8days for example if the script is'nt run for a day it will remove both the 9th and 8th day one not just the 8th day one. If I'm making any sense lol
View 3 Replies View RelatedI want to itemize addition for each type of transactions. The example below is for 3 days,10/13/2010, 10/14/2010, & 10/15/2010.
PROD =89.25+89.25+104.47= 282.97
TAX =9.37+9.37+10.37 = 29.71
ETAX = 1+1+1 = 3
[code]...
Is there a perl module that will let me turn numbers into human readable measures of time? For example, 1280513294 would be "26 days ago". If so, what's its name?
View 2 Replies View RelatedI want to print NaN value in a file containing of 3600 rows and 7 columns.The illustration of output file which I want to is as follows :
NaN NaN NaN NaN NaN NaN NaN (the first row)
NaN .... NaN
.
.
.
NaN .... NaN (the 3600 rows)
I tried to use below command
awk 'BEGIN {for(i = 1; i <= 3600; i++); printf "%s", "NaN", $1" "$2" "$3" "$4" "$5" "$6" "$7}' > output
Unfortunately, I couldn't get what I want to.
I have this code:
How can I print &FARAchieved to a file? Or, printing the whole bioReturn would be fine too.
Say I have a line like such:
Code:
today 2010 Feb 21 test10, 12AM
How would I print everything AFTER "2010 Feb 21 "?
What I thought to do so far is to set a variable to the format used in the string like so:
Code:
date="$(date +%Y %b %e)"
So I know I have to use either awk, sed, or perhaps bash substrings to work with the variable $date, but as to how, I'm drawing a blank.
problem statement:
pattern_search="Exam Name"
sed -n "/$pattern_search/,/hello/"p tmp5 | awk '{if ( $4 != 0 && $4 ~ /[0-9]+.*[0-9]*/ ) print "$pattern_search" " " $0 }'
"tmp5" is a file. this is printing output as
$pattern_search value1
i.e value of $pattern_search is not getting substituted. i am expecting output as
Exam Name value1
I have a site which will have, for example, a login system where people have to enter their usernames and passwords, depending on which they'll be let in to the site. So, in code, I've got a line like:
if ($_POST['password'] == $password) {
then do whatever
}
else { print "Wrong password" ; )
My problem is, this "Wrong password" printing is just a solitary line, not keeping with the colours and style of the site, and it looks very bad. I want to ideally, output some HTML, which will have a picture, and print the "Wrong password" in the font and colours I desire. Do I have to put all the HTML in a print statement, and then deal with the nightmare of escaping all the quote marks in it with a ""? Or is there a cleaner method to the whole thing? Maybe something like this -
if ($_POST['password'] == $password) {
then do whatever
}
[code]....
I've just started programming at my university and I'm finding it a bit hard to get started. I've been given this for homework.Given 2 integers, a and b, print their sum. However, sums in the range 10..19 inclusive, are forbidden, so in that case just print 20The problem I'm having is that i don't know how to tell java to print 20 when the value is in that range.
View 14 Replies View RelatedAny one using php program to direct lpt port print command, now i am creating one programe for mini shope that system having citizen CT-S4000 model.
View 2 Replies View Relatedi want to print all ASCII characters kind of like a table, but i really don't have an idea of how to do it, i don't know if there is a built-in method or something to accomplish this, if not
View 2 Replies View RelatedI am trying to write a program that monitors when an lp or basically any sort of print command is issued. If a print command is detected I want to pause that job and ask the user if he / she wants to continue.
This program would run in the background all the time so it can't sit and eat up a lot of cpu. I tried a simple while loop that continuously monitored "ps" and that obviously boosted my cpu to 100%.
I want to write a script that returns me name of the files that begin with the specified characters. like
Script out should be
how do i combine these two lines to output all network interfaces on my machine?
View 1 Replies View RelatedI am just trying to run the following piece of awk code. But it doesn't print anything. where I am doing wrong?
[code]...
I've been working on it for over 20 hours and I'm stuck. It asks the user for input and then prints a shape of a certain length.
View 4 Replies View RelatedWhat's the difference between PHP echo() and PHP print(), especially in the execution time?
View 6 Replies View RelatedI need some direction on a small scripting question. I've been doing some development and storing the code on a network drive with multiple user access. My development is getting complex enough that it is time to set up a svn repo for it. I would like to set up a little script (if possible) that prints a message/reminder to whomever is accessing the code directory stating that the code is ultimately stored in svn and any changes need to be checked in, etc. Is there a way to have linux print a message to the screen based on a 'cd /specific_dir/' command? So far google is mum on the topic. Using Debian and bash shell.
View 5 Replies View Related