09-27-2006
i am trying to compress all files older than ten days old.. your script, as such:
Quote:
"awkscript" 23 lines, 255 characters
#! /bin/ksh
read x
for file in `ls -lF | awk '{$6 == "Sep" && $7 < "18"}'`
do
mv $file compressed.tar/$file
read x
done
for file in `ls -lF | awk '{$6 != "Sep"}'`
do
mv $file compressed.tar/$file
read x
done
tar -cvf compressed.tar tartar
gives these errors:
Quote:
$ ./awkscript
awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 1
awk: illegal statement near line 1
tar: compressed.tar: Is a directory
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I'm a total beginner at awk and hope someone can advise what I have done wrong in the following script:
I have a file which (to simplify things) may be something like this
Fred Smith and Sue Brown
Joe Jones and Jane Watts
Sally Green and Jim O?
Connor
Freda O?
Reiley and Pat O?... (2 Replies)
Discussion started by: Bab00shka
2 Replies
2. Shell Programming and Scripting
hi everyone,
i have a script that I use regulary to look through my files and directories it works fine, but I would like to add a segment to the script to make the output more readable and userfriendly..
(i am not an expert on scripts so there is no comments or status exits as of yet..
)... (3 Replies)
Discussion started by: moxxx68
3 Replies
3. Shell Programming and Scripting
This is a search script that I have developed. It finds the records that I look for. However the only thing I want the program to do now is to display a message such as 'Not Found' to appear when a record is not found. So far when a search doesn't display a record, the screen is blank.
... (14 Replies)
Discussion started by: Warrior232
14 Replies
4. Shell Programming and Scripting
I need a hand with this simple script,
in Unix i have a variable called portal:
$ echo $portal
chu0
when i use awk this variable is not recognized. How can i make awk recognize and print the value of this variable, since the output is not shown i.e.
awk '
BEGIN {printf("%4s\t%14s\n",... (3 Replies)
Discussion started by: alexcol
3 Replies
5. Shell Programming and Scripting
Hi all,
I have set up a simple awk script to calculate the average of values that are printed out a number of times per second (the number of time the printing occurs varies). The data is of the format shown below:
1 4.43
1 3.65
1 2.45
2 7.65
2 8.23
2 5.65
3 4.65
3 6.21
.. ..
120... (4 Replies)
Discussion started by: omnomtac
4 Replies
6. UNIX for Dummies Questions & Answers
I have a string of letters. (They happen to be DNA, not that it's relevant to the question.) For analysis purposes, I need to replace the information at some of the sites. I need to do this based on their position, not the information in that position.
I also need to ignore differences at other... (10 Replies)
Discussion started by: JFS
10 Replies
7. Shell Programming and Scripting
Hi,
I just don't understand awk. I think I'm close here but can someone give me a hand to finish this little parsing routine ?
the input file is formatted like this:
District 2502110
Gsub 2384889
Gsub 1428180
District 2502220
Gsub 1466390
Gsub 1466389
Gsub 1466388
Gsub 1466386
Gsub... (4 Replies)
Discussion started by: fwellers
4 Replies
8. Shell Programming and Scripting
Guys,
I am new in awk , I face problem while i try to use for loop in awk,
I am using ksh, i am trying to set a for loop which runs as man times as the records in a file , the for loop like for(a=1;a<=5;a++) is working in my awk script but the one i need is not working :wall:
for example
... (8 Replies)
Discussion started by: djahmed
8 Replies
9. Shell Programming and Scripting
please help me to execute a simple shell script like
for i in `ls
echo $i
done
. i dont want to create a new sh file to execute it. Can i just type and execute it ? because I always this kind of simple for loops .
Please help .
Thanks (7 Replies)
Discussion started by: Sooraj_Linux
7 Replies
10. Shell Programming and Scripting
but I'm stumped...please help
I have a file like this.......
1000 1 34
1000 10 34
1000 11 35
1000 20 35
1000 21 36
1000 30 36
2000 1 34
2000 10 34
which I would like printed out as 40 lines
1000 1 34
1000 2 34
1000 3 34
1000 4 ... (2 Replies)
Discussion started by: garethsays
2 Replies
deb(5) dpkg suite deb(5)
NAME
deb - Debian binary package format
SYNOPSIS
filename.deb
DESCRIPTION
The .deb format is the Debian binary package file format. It is understood since dpkg 0.93.76, and is generated by default since dpkg 1.2.0
and 1.1.1elf (i386/ELF builds).
The format described here is used since Debian 0.93; details of the old format are described in deb-old(5).
FORMAT
The file is an ar archive with a magic value of !<arch>. Only the common ar archive format is supported, with no long file name
extensions, but with file names containing an optional trailing slash, which limits their length to 15 characters (from the 16 allowed).
File sizes are limited to 10 ASCII decimal digits, allowing for up to approximately 9536.74 MiB member files.
The tar archives currently allowed are, the old-style (v7) format, the pre-POSIX ustar format, a subset of the GNU format (new style long
pathnames and long linknames, supported since dpkg 1.4.1.17; large file metadata since dpkg 1.18.24), and the POSIX ustar format (long
names supported since dpkg 1.15.0). Unrecognized tar typeflags are considered an error. Each tar entry size inside a tar archive is
limited to 11 ASCII octal digits, allowing for up to 8 GiB tar entries. The GNU large file metadata support permits 95-bit tar entry sizes
and negative timestamps, and 63-bit UID, GID and device numbers.
The first member is named debian-binary and contains a series of lines, separated by newlines. Currently only one line is present, the
format version number, 2.0 at the time this manual page was written. Programs which read new-format archives should be prepared for the
minor number to be increased and new lines to be present, and should ignore these if this is the case.
If the major number has changed, an incompatible change has been made and the program should stop. If it has not, then the program should
be able to safely continue, unless it encounters an unexpected member in the archive (except at the end), as described below.
The second required member is named control.tar. It is a tar archive containing the package control information, either not compressed
(supported since dpkg 1.17.6), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since 1.17.6) or zstd (with
.zst extension, supported since 1.19.0.5ubuntu2), as a series of plain files, of which the file control is mandatory and contains the core
control information, the conffiles, triggers, shlibs and symbols files contain optional control information, and the preinst, postinst,
prerm and postrm files are optional maintainer scripts. The control tarball may optionally contain an entry for '.', the current
directory.
The third, last required member is named data.tar. It contains the filesystem as a tar archive, either not compressed (supported since
dpkg 1.10.24), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since dpkg 1.15.6), zstd (with .zst
extension, supported since 1.19.0.5ubuntu2), bzip2 (with .bz2 extension, supported since dpkg 1.10.24) or lzma (with .lzma extension,
supported since dpkg 1.13.25).
These members must occur in this exact order. Current implementations should ignore any additional members after data.tar. Further members
may be defined in the future, and (if possible) will be placed after these three. Any additional members that may need to be inserted after
debian-binary and before control.tar or data.tar and which should be safely ignored by older programs, will have names starting with an
underscore, '_'.
Those new members which won't be able to be safely ignored will be inserted before data.tar with names starting with something other than
underscores, or will (more likely) cause the major version number to be increased.
MEDIA TYPE
Current
application/vnd.debian.binary-package
Deprecated
application/x-debian-package
application/x-deb
SEE ALSO
deb-old(5), dpkg-deb(1), deb-control(5), deb-conffiles(5) deb-triggers(5), deb-shlibs(5), deb-symbols(5), deb-preinst(5), deb-postinst(5),
deb-prerm(5), deb-postrm(5).
1.19.0.5 2018-04-16 deb(5)