04-11-2006
hi
try this
ls -lg | awk '//
{
if(length($7)==4)
{
print $8,$7
}
else
{
print $8, system("date +%Y")
}
}'
it will prints file name and year - if exists otherwise it will print
file name and current year.
it also returns ls -lg output i dont know how to avoid that
might be someone from foroum willhelp us
regards,
swapneel
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
Discussion started by: swamymns
9 Replies
2. UNIX for Advanced & Expert Users
Hey all,
I have a shell that invokes a AWK.
In this AWK i want invoke a function that receives 3 parameters:
date: 20080831
time: 235901
duration: 00023
that function receive this 3 parameters and sum to this value two more seconds:
2008083123590100025
Remember that in case that... (3 Replies)
Discussion started by: anaconga
3 Replies
3. Shell Programming and Scripting
Dear friends, following is the output of a script from which I want to remove spaces and new-line characters.
Example:-
Line1 abcdefghijklmnopqrstuvwxyz
Line2 mnopqrstuvwxyzabcdefghijkl
Line3 opqrstuvwxyzabcdefdefg
Here in above example, at every starting line there is a “tab” &... (4 Replies)
Discussion started by: anushree.a
4 Replies
4. UNIX for Advanced & Expert Users
I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies
5. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
6. Shell Programming and Scripting
I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank).
In a first approach I coded:
find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt
But this doesn't work. I got an error (under Ubuntu):
grep:... (5 Replies)
Discussion started by: pstein
5 Replies
7. Shell Programming and Scripting
Hi Guys,
I am working in ksh88 and need the output of "ps -ef" command to give me the exact match of my pattern, for example:
$ ps -ef 'gen_sub'
UID PID PPID NLWP PGID SID STIME TIME COMMAND
op 9209 8249 1 9209 9209 14:52:57 00:00 /usr/bin/ksh... (3 Replies)
Discussion started by: aoussenko
3 Replies
8. Shell Programming and Scripting
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies
9. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
10. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT DEBIAN
keymod
KEYMOD(1p) User Contributed Perl Documentation KEYMOD(1p)
NAME
keymod - Modifies key parameters in a DNSSEC-Tools keyrec file
SYNOPSIS
keymod [options] keyrec1 ... keyrecN
DESCRIPTION
keymod modifies the key parameters in a keyrec file that are used to generate cryptographics keys used to sign zones. The new parameters
will be used by zonesigner when generating new keys. It has no effect on existing keys.
zonesigner will use the new parameter for a zone the next time it generates a key that requires that parameter. This means that, for
example, a new ZSK length will not be used during the next invocation of zonesigner if that invocation will be performing KSK-rollover
actions.
The following fields may be modified:
kskcount - count of KSK keys
ksklength - length of KSK keys
ksklife - lifetime of KSK keys
random - random number generator device file
revperiod - revocation period for KSK keys
zskcount - count of ZSK keys
zsklength - length of ZSK keys
zsklife - lifetime of ZSK keys
New key/value fields will be added to a zone keyrec file to inform zonesigner that new values should be used. The key portion of the added
fields will begin with "new_". For example, a new KSK length of 2048 will be written to the keyrec file as:
new_ksklength 2048
All zone records in the specified keyrec file will be modified, unless the -zone option is given. In that case, only the named zone will
be modified.
If a zone keyrec already contains a new key/value field, then the value will be modified on subsequent runs of keymod.
OPTIONS
keymod recognizes the following options. Multiple options may be combined in a single keymod execution.
All numeric values must be positive or zero.
If a new key/value field should be deleted from a zone keyrec, then a zero or empty string value should be specified for the appropriate
option.
-zone zonename
The zone keyrec whose name matches zonename is selected as the only keyrec that will be modified. If this name is not given, then all
zone keyrec records will be modified.
-ksklength ksklength
The ksklength field will be modified in the selected keyrec records to the given value. This is a numeric field whose values depend on
the cryptographic algorithm to be used to generate keys for the zone.
-kskcount kskcount
The kskcount field will be modified in the selected keyrec records to the given value. This is a numeric field.
-ksklife ksklife
The ksklife field will be modified in the selected keyrec records to the given value. This is a numeric field.
-random random
The random field will be modified in the selected keyrec records to the given value. This is a text field that will be passed to the
key generator.
-revperiod revperiod
The revperiod field will be modified in the selected keyrec records to the given value. This is a numeric field.
-zskcount zskcount
The zskcount field will be modified in the selected keyrec records to the given value. This is a numeric field.
-zsklength zsklength
The zsklength field will be modified in the selected keyrec records to the given value. This is a numeric field whose values depend on
the cryptographic algorithm to be used to generate keys for the zone.
-zsklife zsklife
The zsklife field will be modified in the selected keyrec records to the given value. This is a numeric field.
-nocheck
If this option is given, the krfcheck command will not be run on the modified keyrec file.
-verbose
Display information about every modification made to the keyrec file.
-Version
Displays the version information for keymod and the DNSSEC-Tools package.
-help
Display a usage message.
COPYRIGHT
Copyright 2012 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details.
AUTHOR
Wayne Morrison, tewok@tislabs.com
SEE ALSO
zonesigner(8), krfcheck(8)
Net::DNS::SEC::Tools::keyrec.pm(3)
file-keyrec(5)
perl v5.14.2 2012-06-21 KEYMOD(1p)