Sponsored Content
Top Forums Shell Programming and Scripting Add column that shows how old a file is Post 302372727 by cdunavent on Wednesday 18th of November 2009 03:10:07 PM
Old 11-18-2009
The syntax:

Code:
$ cat test
#!/bin/ksh
for FILENAME in /home/voicem/ivr/arivra
do
let AGE=(`date %s`-`date -r $FILENAME %s`)/86400
done


Results of running script:

$ ./test
./test: syntax error at line 4: `(' unexpected

Last edited by cdunavent; 11-18-2009 at 04:26 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to add a particular column alone in a file

Hi I have file which contains 5 coulmns i need to add the fifth column value and put it in the desired location in the same column. Here is the sample file.. ashop0004 SQL- 06/14/2009 06/14/2009 00:04:28 SUM ashop0004 SQL- 06/14/2009 06/14/2009 00:00:37 ... (22 Replies)
Discussion started by: cutechaps
22 Replies

2. Shell Programming and Scripting

Need to add letters to a column and add in a new column subtracting from another column

So I have this input 1 10327 rs112750067 T C . PASS DP=65;AF=0.208;CB=BC,NCBI 1 10469 rs117577454 C G . PASS DP=2055;AF=0.020;CB=UM,BC,NCBI 1 10492 rs55998931 C T . PASS DP=231;AF=0.167;CB=BC,NCBI 1 10583 rs58108140 G A ... (3 Replies)
Discussion started by: kellywilliams
3 Replies

3. Shell Programming and Scripting

Add column to a file

Hola, How can I add a column to a existing file?? PS: The column which should be added need to be the first column and it will be a parameter from the script. Example: 1 name1 2 name2 3 name3 4 name3 Need to add parameter $file as a first column. $file is a file name with time... (6 Replies)
Discussion started by: Olivia
6 Replies

4. Shell Programming and Scripting

How to add a column from other file?

Dear all, Lets say, I've a file a.txt containing two columns, like a1 b1 .. .. .. .. and another file b.txt containg two columns, like a1 c1 .. .. .. .. I need to put c1 column from b.txt file to the a.txt file. So, the output should be a1 b1 c1 .. .. .. .. ... (4 Replies)
Discussion started by: mkg
4 Replies

5. Shell Programming and Scripting

How to add day of week at the end of each line that shows the date?

I have a file that looks like: file1: www_blank_com 20121008153552 www_blank_com 20121008162542 www_blank_com 20121009040540 www_blank_com 20121009041542 www_blank_com 20121010113548 www_blank_com 20121011113551 www_blank_com 20121012113542 I want the new file to show the day of... (3 Replies)
Discussion started by: castrojc
3 Replies

6. Shell Programming and Scripting

Help with add existing file name as new data column in new output file

Input File 1 cat S1.txt MI0043 2731 miR-1 Input File 2 cat S4.txt MI006 310 CiR-1 MI057 10 CiR-24 MI750 5 CiR-24 Desired Output File 1 cat S1.txt.out MI0043 2731 miR-1 S1.txt Desired Output File 2 cat S4.txt.out MI006 310 CiR-1 S4.txt (3 Replies)
Discussion started by: perl_beginner
3 Replies

7. Shell Programming and Scripting

Add a new column to file

I have file like this b,c 10,20 30,40 50,60 Now I want to add a new column a with fixed values for all the rows a,b,c 60,10,20 60,30,40 60,50,60 Please let me know how can we do this in unix. (4 Replies)
Discussion started by: weknowd
4 Replies

8. UNIX for Dummies Questions & Answers

Add a column to a file

Hi, I have this data file that contains: 1 A 2 B 3 C 4 D 5 E 6 F 7 G 8 H 9 I I want the results to be: 1 A A 2 B A 3 C A 4 D A 5 E A 6 F A 7 G A 8 H A (8 Replies)
Discussion started by: bobo
8 Replies

9. Shell Programming and Scripting

Add new column in the file

Hi Team I have file as below empno,ename,sal 123,smith,1000 124,adams,2000 Required output: Using AWK empno,ename,sal,deptno 123,smith,1000 124,adams,2000 Thanks, Murali (5 Replies)
Discussion started by: bmk
5 Replies

10. UNIX for Beginners Questions & Answers

Add new column from another file

Hi, I have 2 files. file1 contains by lines: hash:salt:id file2 contains by lines: username:hash:salt I would like to add a new coloumn (id) form file1 to file2. The new file should contains: username:hash:salt:id Note: file1 contains less rows than file2. I tried paste -d':' file1... (12 Replies)
Discussion started by: freeroute
12 Replies
W2DO(1) 						User Contributed Perl Documentation						   W2DO(1)

NAME
w2do - a simple text-based todo manager SYNOPSIS
w2do [-l] [-t task] [-g group] [-d date] [-p priority] [-f|-u] w2do -a task [-g group] [-d date] [-p priority] [-f|-u] w2do -c id [-t task] [-g group] [-d date] [-p priority] [-f|-u] w2do -r id w2do [options] DESCRIPTION
w2do is a simple to use yet efficient command-line todo manager written in Perl. OPTIONS
General Options -l, --list Display items in the task list. All tasks are listed by default, but desired subset can be easily selected via specifying options as well. Since listing is the default action, this option can be safely omitted. -a task, --add task Add new item with selected task name to the task list. When no additional specifying options are given, the group general, the due date anytime and the priority 3 is used by default and the task is marked as unfinished. -c id, --change id Change item with selected id in the task list. Further specifying options are required in order to take any effect. -r id, --remove id Remove item with selected id from the task list. --change-group group Change all items in the selected group. Further specifying options are required in order to take any effect. --remove-group group Remove all items from the selected group. --purge-group group Remove all finished items from the selected group. --change-date date Change all items with selected due date. Further specifying options are required in order to take any effect. --remove-date date Remove all items with selected due date. --purge-date date Remove all finished items with selected due date. --change-pri priority Change all items with selected priority. Further specifying options are required in order to take any effect. --remove-pri priority Remove all items with selected priority. --purge-pri priority Remove all finished items with selected priority. --change-old Change all items with passed due date. Further specifying options are required in order to take any effect. --remove-old Remove all items with passed due date. --purge-old Remove all finished items with passed due date. --change-all Change all items in the task list. Further specifying options are required in order to take any effect. --remove-all Remove all items from the task list. --purge-all Remove all finished items from the task list. --undo Revert last action. When invoked, the data are restored from the backup file (i.e. "~/.w2do.bak" by default), which is deleted at the same time. --groups Display comma-delimited list of all groups in the task list. --stats Display detailed task list statistics. -h, --help Display help message and exit. -v, --version Display version information and exit. Specifying Options -t task, --task task Specify the task name. -g group, --group group Specify the group name. The group name should be a single word with maximum of 10 characters, but longer names are shortened automatically. -d date, --date date Specify the due date. Available options are anytime, today, yesterday, tomorrow, month, year, or an exact date in the YYYY-MM-DD format, e.g. 2008-06-17 for 17 June 2008. -p priority, --priority priority Specify the priority. Available options are integers between 1 and 5, where 1 represents the highest priority. -f, --finished Specify the finished task. -u, --unfinished Specify the unfinished task. Additional Options -s file, --savefile file Use selected file instead of the default "~/.w2do" as a save file. -w width, --width width Use selected line width; the minimal value is 75. -q, --quiet Avoid displaying messages that are not necessary. -V, --verbose Display all messages; this is the default option. -C, --colour, --color Use coloured output instead of the default plain text version. -X, --no-colour, --no-color Use plain text output (no colours); this is the default option. -b, --bare Do not display table header and group separators. -B, --no-bare Display table header and group separators; the default option. -I, --no-id Do not display ID column in the listing. --with-id Display ID column in the listing; the default option. -G, --no-group Do not display group column in the listing. --with-group Display group column in the listing; the default option. -D, --no-date Do not display due date column in the listing. --with-date Display due date column in the listing; the default option. -P, --no-priority Do not display priority column in the listing. --with-priority Display priority column in the listing; the default option. -S, --no-state Do not display state column in the listing. --with-state Display state column in the listing; the default option. ENVIRONMENT
W2DO_SAVEFILE Use selected file instead of the default "~/.w2do" as a save file. W2DO_WIDTH Use selected line width; the minimal value is 75. FILES
~/.w2do Default save file. ~/.w2do.bak Default backup file. SEE ALSO
w2html(1), w2text(1), perl(1). BUGS
To report bugs or even send patches, you can either add new issue to the project bugtracker at <http://code.google.com/p/w2do/issues/>, visit the discussion group at <http://groups.google.com/group/w2do/>, or you can contact the author directly via e-mail. AUTHOR
Written by Jaromir Hradilek <jhradilek@gmail.com>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included as a file called FDL in the main directory of the w2do source package. COPYRIGHT
Copyright (C) 2008, 2009, 2010 Jaromir Hradilek This program is free software; see the source for copying conditions. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Version 2.3.1 2010-02-13 W2DO(1)
All times are GMT -4. The time now is 01:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy