01-16-2002
How about in SCO UNIX...?
is there still a typeset command?
i type "man typeset" it said not found
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:confused: How does UNIX handle the numbering of processes? (2 Replies)
Discussion started by: tweety111
2 Replies
2. Shell Programming and Scripting
I'm trying to do a script that will look for a log file if it is already there change the name to another name.
I.E
if log.0 is there
rename to log.1
rename log.1 to log.2
rename log.2 to log.3 and so on.
Only thing is I got no idea where or what is the best command to use for this? ... (3 Replies)
Discussion started by: merlin
3 Replies
3. UNIX for Advanced & Expert Users
hello i'm trying to figure out how to number a blank line. For instance this :
sed '/./=' file | sed '/./N; s/\n/ /'
gives me
1 aaaa
2 bbbbbb
4 cccccc
5 ffkkkfff
6 ffsdfdfs
I would like something like this:
1 aaaaa
2
3 bbbbbb
4
5 cccccc
And so... (6 Replies)
Discussion started by: wisher115
6 Replies
4. Shell Programming and Scripting
Hello everyone,
I want get numbered lines from a file. and i can do it with: sed = file.txt | sed "/./N; s/\n/ /" | sed -n "5,7p"
but the output that i get is something similar to:
5 line5
6 line6
7 line7
and i want something like this (with 2points after the number):
5:... (6 Replies)
Discussion started by: vibra
6 Replies
5. Shell Programming and Scripting
Hi,
I have this large file and sometimes there are duplicates and I want to basically find them and figure how many there are.
So I have a file with multiple columns and the last column (9) has the duplicates.
eg.
yan
tar
tar
man
ban
tan
tub
tub
tub
Basically what I want to... (6 Replies)
Discussion started by: kylle345
6 Replies
6. UNIX for Dummies Questions & Answers
If I a list of components, is there anyway to number (like automatically have: 1,2,3,...) the rows of my data? (1 Reply)
Discussion started by: cosmologist
1 Replies
7. Shell Programming and Scripting
Hi,
All I need to do is number a file.
The file looks like this
>
JJJJJJJJJJJJJJJJJJJJJ
>
JKJKJKKKKKKJJJ
>
MMMMYKKKJKKK
what I want to do is number it so that theres a numerical value beside the >.
>1
JJJJJJJJJJJJJJJJJJJJJ
>2
JKJKJKKKKKKJJJ (2 Replies)
Discussion started by: kylle345
2 Replies
8. Shell Programming and Scripting
Would it be possible for a script to duplicate a file and incrementally number it?
File in: XXX_007_0580_xxxx_v0016.aep
File out: XXX_007_0580_xxxx_v0017.aep
If someone knows of a way I'd love to see it.
Thanks! (7 Replies)
Discussion started by: scribling
7 Replies
9. Shell Programming and Scripting
Hi I am in a bind, I need create a script that will rename files as they come into a folder with sequential numbering at the begining starting at 1 and proceeding to ten then starting at 1 again. Such as 1_filename.pdf, 2_filename.pdf, 3_filename.pdf, 4_filename.pdf, 5_filename.pdf, 6_filename.pdf,... (6 Replies)
Discussion started by: Paul Walker
6 Replies
10. Shell Programming and Scripting
I'm not really sure how to explain this but I will try. In the attached file if $4=$4 and $5="-" then the last record is 1 and the one above that is 2, etc...
However, $4=$4 and $5="-" then the first record is 1 and the one below that is 2, etc...
"-" example:
chr10 90694830 90695123... (7 Replies)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT REDHAT
nanosleep
NANOSLEEP(2) Linux Programmer's Manual NANOSLEEP(2)
NAME
nanosleep - pause execution for a specified time
SYNOPSIS
#include <time.h>
int nanosleep(const struct timespec *req, struct timespec *rem);
DESCRIPTION
nanosleep delays the execution of the program for at least the time specified in *req. The function can return earlier if a signal has
been delivered to the process. In this case, it returns -1, sets errno to EINTR, and writes the remaining time into the structure pointed
to by rem unless rem is NULL. The value of *rem can then be used to call nanosleep again and complete the specified pause.
The structure timespec is used to specify intervals of time with nanosecond precision. It is specified in <time.h> and has the form
struct timespec
{
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
The value of the nanoseconds field must be in the range 0 to 999 999 999.
Compared to sleep(3) and usleep(3), nanosleep has the advantage of not affecting any signals, it is standardized by POSIX, it provides
higher timing resolution, and it allows to continue a sleep that has been interrupted by a signal more easily.
ERRORS
In case of an error or exception, the nanosleep system call returns -1 instead of 0 and sets errno to one of the following values:
EINTR The pause has been interrupted by a non-blocked signal that was delivered to the process. The remaining sleep time has been written
into *rem so that the process can easily call nanosleep again and continue with the pause.
EINVAL The value in the tv_nsec field was not in the range 0 to 999 999 999 or tv_sec was negative.
BUGS
The current implementation of nanosleep is based on the normal kernel timer mechanism, which has a resolution of 1/HZ s (i.e, 10 ms on
Linux/i386 and 1 ms on Linux/Alpha). Therefore, nanosleep pauses always for at least the specified time, however it can take up to 10 ms
longer than specified until the process becomes runnable again. For the same reason, the value returned in case of a delivered signal in
*rem is usually rounded to the next larger multiple of 1/HZ s.
As some applications require much more precise pauses (e.g., in order to control some time-critical hardware), nanosleep is also capable of
short high-precision pauses. If the process is scheduled under a real-time policy like SCHED_FIFO or SCHED_RR, then pauses of up to 2 ms
will be performed as busy waits with microsecond precision.
CONFORMING TO
POSIX.1b (formerly POSIX.4).
SEE ALSO
sleep(3), usleep(3), sched_setscheduler(2), timer_create(2)
Linux 1.3.85 1996-04-10 NANOSLEEP(2)