03-28-2008
display filename with date
Hi buddies,
I have a doubt. I want to display filename with date in the following format.Is there any way to do this. Kindly give me the solution.
I want to display the result in the following manner.
test1.txt 03/28/2008
testlog.log 02/20/2008
Please let me know one solution how to do this.
Thanks in advance
pstanand
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm just learning UNIX and I'm trying to do the following:
Write a script called details.bash that, for each file in the working directory, prints the filename, the # of lines, and the # of words to to some output file, like this:
filename1 73 431
filename2 5 21
It's probably a stupid... (1 Reply)
Discussion started by: asianmike
1 Replies
2. UNIX for Dummies Questions & Answers
I would like to display the last 8 characters of the filenames for filenames of different lengths.
I can delete the last 8 characters with sed but dont know how to only show the last 8 characters.
The filenames are something like;
afxH340800340000
afxH30800340021
afxR3080034002122
I... (3 Replies)
Discussion started by: Beanz
3 Replies
3. UNIX for Dummies Questions & Answers
Hi i am currently using below command in shell script and calling it from cron job.
This is to take daily backup with the date as suffix to the file.When i try i unable to get the date suffixed to the backup file.
Please help me as to wt's wrong in this or how to get the date added to the... (5 Replies)
Discussion started by: abhi_n123
5 Replies
4. Shell Programming and Scripting
Hi i'm new to the forum and was hoping someone could help me with the following query.
I do alot of testing and have hundreds of log files output. I have a script (someone else wrote) which finds all the passed and failed logs and puts a number in a column onto a webpage:
e.g:
Pass ... (4 Replies)
Discussion started by: defamer
4 Replies
5. Shell Programming and Scripting
I am using ksh93 on Solaris.
Ok, this may seem like a simple request at first. I have a directory that contains sets of files with a YYYYMMDD component to the name, along with other files of different filespecs. something like this:
20110501_1.dat
20110501_2.dat
20110501_3.dat... (2 Replies)
Discussion started by: gary_w
2 Replies
6. Shell Programming and Scripting
Well guys,
I know the right syntax for displaying the current date is $(date). However, I am planning to send emails to some customers which displays their subscription date, and then the expiry. The expiry being 30 days from the current date.
What would the right syntax be? (6 Replies)
Discussion started by: xxxx
6 Replies
7. Shell Programming and Scripting
Hello, all!
Working in a Bourne shell. What command would list the filename and size of a file if the size of the file had to be bigger than $a and smaller than $b?
Output (if $a is 10 bytes and $b is 50 bytes):test1.txt 15
test2.txt 30
test3.txt 50
Thanks,
Ann :p (3 Replies)
Discussion started by: LowlyIntern
3 Replies
8. Shell Programming and Scripting
Hello,
I'd like to write a monthly archive script that archives some logs. But I'd like to do it based on yesterday's date. In other words, I'd like to schedule the script to run on the 1st day of each month, but have the archive filename include the previous month instead.
Here's what I... (5 Replies)
Discussion started by: nbsparks
5 Replies
9. Shell Programming and Scripting
Hi All
How to answer the below interview question..
With a path and filename of "/mydir1/mydir2/mydir3/myfilenane.dat" write a UNIX script to display the filename (2 Replies)
Discussion started by: shumail
2 Replies
10. UNIX for Beginners Questions & Answers
Suppose i have a list of files in a directory as mentioned below
1. Shankar_04152019_ny.txt
2. Gopi_shan_03122019_mi.txt
3. Siva_mourya_02242019_nd.txt
..
.
.
.
.
1000 . Jiva_surya_02282019_nd.txt
query : At one shot i want to modify the above all filenames present in one path with... (4 Replies)
Discussion started by: Shankar455
4 Replies
LEARN ABOUT DEBIAN
wuzzah
wuzzah(1) Wuzzah? wuzzah(1)
NAME
wuzzah - keep an eye out for friends on a local system
SYNOPSIS
wuzzah [OPTIONS...]
DESCRIPTION
wuzzah is a program that just sits around and scans the utmpx entries to watch when your friends log in and out. By default upon invoca-
tion, wuzzah looks for the file ${HOME}/.wuzzah, and loads the list of buddies contained therein (which are separated by newlines), and
then sits and watches. If no file is found, and no other readable file is specified (see OPTIONS), wuzzah will attempt to just watch for
whomever the current uid maps, and failing that will just quit.
OPTIONS
-h, --help
an informative usage summary, though nothing you don't see here...
-a, --all-users
watches for all users on the system, period.
-c, --exec-cmd=CMD
execute CMD upon a login. NOTE: this is done with a call to system(2), so you can do things like piping and whatever else you can
do with sh -c
-f, --buddy-file=FILE
use FILE as buddyfile. naturally FILE must be readable, and consists of usernames, one to a line. optionally, these usernames can
be followed by a colon, and then a wuzzah command-line to override wuzzah's behavior for this specific user.
-F, --no-buddyfile
tells wuzzah to not bother loading any config files.
-i, --interval=NUM
sleep NUM seconds between each polling
-m, --message=STRING
use STRING as a message template to greet logged-in buddies. See the section FORMATS for more information.
-n, --no-newline
don't end the messages with newlines (normally does by default)
-o, --process-once
scan the login records once, then exit
-p, --process-current
by default wuzzah doesn't message users who were already logged in when started up. this option overrides such behavior and mes-
sages them anyways (only useful with the -w/-c options)
-q, --silent
don't message buddies when they log in (default).
-s, --status-message=STRING
use STRING as a template for displaying the status of people logging in and out. See FORMATS for more information.
-u, --users=LIST
adds every user in LIST (a space/comma/colon separated list of users) to the buddy list
-v, --version
the current version and copyright.
-w, --write-buddies
turns on messaging of buddies as they log in. NOTE: this can get quite annoying rather quickly. tune in soon for a less annoying
solution
FORMATS
message templates can be defined as normal character strings, interspersed with special format characters. format characters consist of a
`%', followed by a character, which defines situation-specific data. The current list of these characters is as follows:
a the alert character ('a')
b the name of the buddy who has logged in/out
d the date, currently in HH:MM:SS format
h and H
the remote hostname or IP address (respectively) of your buddy's login
l the line in/out on which the buddy is logged (typically, something like /dev/pts/9 or /dev/ttyS0)
m whether or not you have just messaged your buddy (really only useful for the -s option)
n an embedded newline character
o your buddy's online status ("logged on" or "logged off")
u your own username, as can best be determined by the program.
EXAMPLES
a simple invocation:
username@machine$ wuzzah
(13:45:39) foo logged in on :0 (not messaging).
(13:45:39) bar logged in on pts/11 (not messaging).
Message from username@machine on pts/11 at 14:00 ...
(wuzzah) username says: "shoutout to my homie foo."
EOF
an example with a little more user customization:
username@machine$ wuzzah --message="hey, %b, it's %u. nice to see you at %d!"
and when foo logs in, foo will get a message like so:
Message from username@machine on pts/11 at 14:00 ...
hey, foo, it's username. nice to see you at (14:00:00)!
EOF
FILES
$HOME/.wuzzah
the default file containing the list of users to watch
BUGS
don't know of any, but reports (and patches too) are always welcome. feel free to send them to the author.
AUTHOR
sean finney <seanius@seanius.net>
sean finney Sun Nov 17 02:41:45 EST 2002 wuzzah(1)