11-12-2015
Doh! I wanted the loop in awk and overlooked the smart lookup (substr($0,35,7) in nums)
Thanks for showing it!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I have tried so many command but none work like i wanted.
I would like archive which i assume it will move the files and archive it somewhere.
for example:
if i have a folder and files:
/home/blah/test
/home/blah/hello
/home/blah/foo/bar
i would like to archive folder... (6 Replies)
Discussion started by: c00kie88
6 Replies
2. Shell Programming and Scripting
Hi Friends,
I want a shell script which will move certain .jar files from a specified location (say /publish/content) to (/publish/archive) on every saturday morning 6 am.
One more thing to add is that before moving files it must check free space at (/publish/archive), if it is more than 60 %... (7 Replies)
Discussion started by: abhishek27
7 Replies
3. Shell Programming and Scripting
I'm a novice at unix and need it more and more to do my work.
I seem running into problems getting this script "attempt" to work:
I need to copy all files in a directory, which is containing 22000 files, into a directory one level up. There a tool monitors the content of the dir and processes... (2 Replies)
Discussion started by: compasscard
2 Replies
4. Shell Programming and Scripting
File_A contains Strings:
a
b
c
d
File_B contains Strings:
a
c
z
Need to have script written in either sh or ksh. Derive resultant files (File_New_A and File_New_B) from lists File_A and File_B where string elements in File_New_A and File_New_B are listed below.
Resultant... (7 Replies)
Discussion started by: mlv_99
7 Replies
5. UNIX for Dummies Questions & Answers
Hi
I have to move files between file systems but files in new file system must have the same attributes as in old one (privileges, time stamp etc).
Which tool is best :
- ufsdump / ufsrestore
- tar
- cpio
- pax
- dd
- mv
Or maybe there is sth else, you suggest to use.
Thx for help (5 Replies)
Discussion started by: presul
5 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I'm trying to improve my Unix skills and I'm wondering what is the best way to move some files based on filetype and attributes like time created?
For instance, lets suppose I have a directory with many different files in it and I'd like to move all the jpgs that were created between May... (6 Replies)
Discussion started by: LuckyTommy
6 Replies
7. Shell Programming and Scripting
I have a directory e2e_ms_xfer/cent01
this contains the multiple files some of which will be named below with unique date time stamps
e2e_ms_edd_nom_CCYYMMDD_HHMM.csv
What I want to do is in a loop
1) Get the oldest file
2) Rename
3) Move it up one level from e2e_ms_xfer/cent01 to... (1 Reply)
Discussion started by: andymay
1 Replies
8. Shell Programming and Scripting
help me (1 Reply)
Discussion started by: sonu pandey
1 Replies
9. UNIX for Beginners Questions & Answers
If there are 100 files created in a directory /data/ today from 2:00 AM to 10:00 AM
I need to move files older than 3:00 AM to a new directory /hold/
How to do that?
Also, if I have to move files between 3:00 AM to 9:00 AM, how to achieve that (3 Replies)
Discussion started by: eskay
3 Replies
10. Shell Programming and Scripting
Hi, everyone
I have a group lists like this (more lines are omitted:
a b c d
E F G H
....
I want to generate all combinations of two elements in each group line. What I expected is this:
a b
a c
a d
b c
b d
c d
E F
E G
E H
F G
F H
G H (8 Replies)
Discussion started by: nengcheng
8 Replies
LEARN ABOUT OPENSOLARIS
devreserv
devreserv(1M) System Administration Commands devreserv(1M)
NAME
devreserv - reserve devices for exclusive use
SYNOPSIS
devreserv [key [device-list]...]
DESCRIPTION
devreserv reserves devices for exclusive use. When the device is no longer required, use devfree to release it.
devreserv reserves at most one device per device-list. Each list is searched in linear order until the first available device is found. If
a device cannot be reserved from each list, the entire reservation fails.
When devreserv is invoked without arguments, it lists the devices that are currently reserved and shows to which key it was reserved. When
devreserv is invoked with only the key argument, it lists the devices that are currently reserved to that key.
OPERANDS
The following operands are supported:
device-list Defines a list of devices that devreserv will search to find an available device. The list must be formatted as a single
argument to the shell.
key Designates a unique key on which the device will be reserved. The key must be a positive integer.
EXAMPLES
Example 1 Reserving a Floppy Disk and a Cartridge Tape
The following example reserves a floppy disk and a cartridge tape:
$ key=$$
$ echo "The current Process ID is equal to: $key"
The Current Process ID is equal to: 10658
$ devreserv $key diskette1 ctape1
Example 2 Listing All Devices Currently Reserved
The following example lists all devices currently reserved:
$ devreserv
disk1 2423
diskette1 10658
ctape1 10658
Example 3 Listing All Devices Currently Reserved to a Particular Key
The following example lists all devices currently reserved to a particular key:
$ devreserv $key
diskette1
ctape1
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 Command syntax was incorrect, an invalid was option used, or an internal error occurred.
2 Device table or device reservation table could not be opened for reading.
3 Device reservation request could not be fulfilled.
FILES
/etc/device.tab
/etc/devlkfile
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
devfree(1M), attributes(5)
NOTES
The commands devreserv and devfree are used to manage the availability of devices on a system. Their use is on a participatory basis and
they do not place any constraints on the actual access to the device. They serve as a centralized bookkeeping point for those who wish to
use them. Devices which have been reserved cannot be used by processes which utilize the device reservation functions until the reserva-
tion has been canceled. However, processes that do not use device reservation may use a device that has been reserved since such a process
would not have checked for its reservation status.
SunOS 5.11 5 Jul 1990 devreserv(1M)