11-28-2014
We are not here to do your homework for you. Leaving section 3 in the homework template blank isn't a good starting point.
If you put in some effort and show us what you have tried, we can help you hone your solution to one that will get the job done. If you aren't willing to show us that you are making an effort, there isn't much more that we will be willing to do for you.
All that you have shown us is that you can use cut with space as a delimiter to select part of an input line. Could you use cut with a different delimiter to get rid of the [?
What tools are you allowed to use for this assignment? You have shown us cut and we assume that you can use some shell (but we don't know which shell). You have suggestions to use GNU date and awk. Are these available for this assignment? Can you use a 1993 or later version of ksh (which can also perform simple calculations to get the date 10 days ago)?
Are you looking for a date 14 days ago to the second? Or, are you looking for a date starting at midnight almost 14 days ago? Whether or not you can use the date utility depends on what operating system and shell you're using?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What I'm trying to do is perform a copy, well a ditto actually, on the results of a find command, but some inline string substitution needs to happen.
So if I run this code find ./ -name "*.tif" I get back these results.
.//1234567.tif
.//abcdefg.tif
Now the action from exec or xargs I... (2 Replies)
Discussion started by: myndcraft
2 Replies
2. Shell Programming and Scripting
I'm trying to get a case statement to start over if an undefined option is selected... But I am ata loss on how to actually do it.
Here is a quick example of what I have.
Echo "1) do this/n
2) Do that/n
3) Quit/n
Make a selection/n"
Read answer
Case answer in
1) Dothid;;
2) Dothat;;... (3 Replies)
Discussion started by: trey85stang
3 Replies
3. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I have standard web server log file. It contains different columns (like IP address, request result code, request type etc) including a date column with the format .
I have developed a log analysis command line utility that displays... (1 Reply)
Discussion started by: TariqYousaf
1 Replies
4. Shell Programming and Scripting
In a shell script, I need to grab the first or second line after a search string in a file. For example:
File.out:
Random Info
Manufacturer: XYZPDQ
System Info
Manufacturer: Hewlett-Packard
Product Name: ProLiant
I search for the word FILE, I want to be able to grab the line... (1 Reply)
Discussion started by: jwk1230
1 Replies
5. Shell Programming and Scripting
Hello Unix gurus,
I have a gzipped file where each line contains 2 street addresses in the US. What I want to do is get a count for each state that does not match.
What I have so far is:
$ gzcat matched_10_09.txt.gz |cut -c 106-107,184-185 | head -5
CTCT
CTNY
CTCT
CTFL
CTMA
This cuts... (5 Replies)
Discussion started by: sitney
5 Replies
6. Shell Programming and Scripting
I have a file like this
2011-10-10 10:46:00,1-1-13-1-1,151510,ALCLA0A84D2C
2011-10-10 10:46:00,1-1-13-1-1,151520,65537
2011-10-10 10:46:00,1-1-13-1-1,151515,46932
2011-10-10 10:46:00,1-1-13-1-1,151521,32769
2011-10-10 10:46:00,1-1-13-1-1,151522,32769
2011-10-10... (4 Replies)
Discussion started by: LavanyaP
4 Replies
7. Shell Programming and Scripting
Hello there! I'm having a lot of trouble writing a script.
The script is supposed to:
1) Find all files with the name "Object.mtl" within each folder in the directory: /Users/username/Desktop/convert/Objects
2) Search and replace the string ".bmp" with ".tif" (without the quotations)
3)... (1 Reply)
Discussion started by: Blue Solo
1 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. How can i use loop to repeat task.
2.shirt=15
black=13.50
echo "how many shirt you want"
read num
echo
echo "Please enter a choice"
echo "1 ---> normal... (5 Replies)
Discussion started by: Tauatioti
5 Replies
9. Shell Programming and Scripting
Hi all,
I'm struggling with this task and have done alot of googling but not found the solution or atleast not found a way to combine them, i'm hoping someone here can help me out.
I have a file that contains many line of config "below is two lines for an example"
323 => 1111,Terry berry... (3 Replies)
Discussion started by: 3sparky
3 Replies
10. Shell Programming and Scripting
In the file below I am trying to count the given repeats of A,T,C,G in each string of letters. Each sequence is below the > and it is possible for a string of repeats to wrap from the line above. For example, in the first line the last letter is a T and the next lines has 3 more. I think the below... (10 Replies)
Discussion started by: cmccabe
10 Replies
LEARN ABOUT DEBIAN
lbdb-fetchaddr
LBDB-FETCHADDR(1) User Manuals LBDB-FETCHADDR(1)
NAME
lbdb-fetchaddr - grab addresses from mails add append them to lbdb database
SYNOPSIS
lbdb-fetchaddr [-d dateformat] [-x headerfieldlist] [-c charset] [-a]
lbdb-fetchaddr [-v|-h]
DESCRIPTION
lbdb-fetchaddr is a shell script which reads a mail on stdin. It extracts the contents of some header fields (default: `From:', `To:',
`Cc:', `Resent-From:', and `Resent-To:') from the mail header (only addresses with a real name) and appends them to
$HOME/.lbdb/m_inmail.list. For performance issues lbdb-fetchaddr appends new addresses to this file without removing duplicates. To get
rid of duplicates, the program lbdb-munge exists, which is run by m_inmail if needed and removes duplicates.
To use this program, put the following lines into your $HOME/.procmailrc:
:0hc
| lbdb-fetchaddr
lbdb-fetchaddr writes the actual date to the third column of the database by using strftime(3). It uses "%Y-%m-%d %H:%M" as the default
date format (e.g. "1999-04-29 14:33"). You can change this by using the -d option to select a different date format string as parameter of
lbdb-fetchaddr command like
:0hc
| lbdb-fetchaddr -d "%y-%m-%d"
which results in e.g. "99-04-29".
OPTIONS
-v Print version number of lbdb-fetchaddr.
-h Print short help of lbdb-fetchaddr.
-d dateformat
Use the given date format using strftime(3) syntax.
-x headerfields
A colon separated list of header fields, which should be searched for mail addresses. If this option isn't given, we fall back to
`from:to:cc:resent-from:resent-to'.
-c charset
The charset which will be used to write the database. This should be the charset which the application expects (normally the one
from your current locale). If this option isn't given, we fall back to `iso-8859-15'.
-a Also grab addresses without a real name. Use the local part of the mail address as real name.
FILES
$HOME/.lbdb/m_inmail.list
/usr/lib/lbdb/fetchaddr
/usr/lib/lbdb/m_inmail
SEE ALSO
lbdbq(1), lbdb_dotlock(1), procmail(1), procmailrc(5), strftime(3).
CREDITS
Most of the really interesting code of this program (namely, the RFC 822 address parser used by lbdb-fetchaddr) was stolen from Michael
Elkins' mutt mail user agent. Additional credits go to Brandon Long for putting the query functionality into mutt.
AUTHOR
The lbdb package was written by Thomas Roessler <roessler@guug.de> and is now maintained and extended by Roland Rosenfeld <roland@spin-
naker.de>.
Unix October 2005 LBDB-FETCHADDR(1)