10-09-2001
Quote:
Originally posted by jpprial
wow, thanks. that's getting there, but the -z won't allow for empty fields, which i think are legal, like this line:
ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
Yeah, that line is legal and my code will not reject it. It this case nf will be 3 because there are 3 non-empty fields. Only records where nf is 0 are discarded, these are blank lines.
Quote:
Originally posted by jpprial
doesn't a blank in the runlevel field indicate this should run at all run levels? [/B]
If you leave this field empty, it is the same as specifying "0123456", which means that it will not run in run level s.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello I'm trying to write a shell script which can remove a carriage return and/or line feed from a file, so the resulting file all ends up on one line.
So, I begin with a file like this
text in file!<CR>
line two!<CR>
line three!<CR>
END!<CR>
And I want to end up with a file... (1 Reply)
Discussion started by: tbone231
1 Replies
2. Shell Programming and Scripting
I am using AIX and ksh.
I need to display the contents of a file that has a pid (process id). Because the file is open, it doesn't have the line feed or new line, so for some reason if I do this:
`cat $pid` , where $pid is the name of the fully qualified file, it displays
test3.sh: 426110:... (1 Reply)
Discussion started by: Gato
1 Replies
3. Shell Programming and Scripting
Hi
I have a file with lots of line feeds and form feeds (page break). Need to replace last occurrence of form feed (created by - echo "\f" ) in the file with line feed.
Please advise how can i achieve this.
TIA
Prvn (5 Replies)
Discussion started by: prvnrk
5 Replies
4. Shell Programming and Scripting
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies
5. Shell Programming and Scripting
Hi All,
My requirement is to remove line (3 Replies)
Discussion started by: r_t_1601
3 Replies
6. Shell Programming and Scripting
Hi All,
i have a csv file .
In the 7th column i have data that has line feed in it.
Requirement is to remove the line feed from the 7th column whenever it appears
There are 11 columns in the file
C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11
The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
Discussion started by: r_t_1601
2 Replies
7. Shell Programming and Scripting
Hi All,
I have came across an issue where I will grep for a primary key and then I have to delete that particular line from the feed file and then save it.
The feed file is a TAB delimited one.
For example:
grep 539439AE9 file1
100.00000 20090119 20090119 20090521 ... (4 Replies)
Discussion started by: filter
4 Replies
8. Shell Programming and Scripting
Hi All,
In my output file i am getting control m character and also the line feeds at different places and with different combinations, the content of the file is supposed to be in a single line but if there is a line feed in between then from there onwards it's going into new line.
I tried... (7 Replies)
Discussion started by: Bipin Kumar
7 Replies
9. Shell Programming and Scripting
Hi! I have been struggling with a large file that has stray end of line characters.
I am working on a Mac (Lion). I mention this only because I have been mucking around with fixing my problem using sed, and I have learned far more than I wanted to know about Unix and Mac eol characters.
I... (1 Reply)
Discussion started by: user999991
1 Replies
10. Shell Programming and Scripting
Hi Forum.
I have the following script that splits a large fixed-width file into smaller multiple fixed-width files based on input segment type.
The main command in the script is:
awk -v search_col_pos=$search_col_pos -v search_str_len=$search_str_len -v segment_type="$segment_type"... (8 Replies)
Discussion started by: pchang
8 Replies
LEARN ABOUT HPUX
ups_mond
ups_mond(1M) ups_mond(1M)
NAME
ups_mond - HP PowerTrust Uninterruptible Power System monitor daemon
SYNOPSIS
configfile]
DESCRIPTION
When it detects a loss of AC power for a period of time exceeding a configured limit, ensures file system integrity by shutting down HP-UX.
To do this, uses the device special files specified in its configuration file by default) to monitor the state of each HP PowerTrust Unin-
terruptible Power System (UPS) attached to the system.
Use the option to specify a configuration file other than See ups_conf(4) for a description of the configuration file format.
By default, is locked into memory (see plock(2)). That is, is not swappable. Although extreme caution is required, you can make swappable
if all swap disks are powered by an uninterruptible power system (assured to have power when the primary power source fails). To make
swappable, use the option.
When is forced to shutdown the system, it executes the command with real-time priority (default behavior). can be configured to execute
command with a timeshare (non-real-time) priority by using the option.
is started by (see init(1M)) by means of an entry in the file (see inittab(4)). The entry uses the option to automatically restart if is
terminated by the command (see kill(1)). This entry should follow the entry:
so that is started after the system logging daemon It should also be run with real-time priority to assure its execution (see rtprio(1)).
logs messages, and when appropriate invokes using the option, or For each configured UPS, can be instructed (in to log messages only, with-
out taking or action. See MSG_ONLY in ups_conf(4). By default performs the and actions.
Note that when the shutdown is performed, UPSs that have lost AC line voltage will be turned off once the shutdown_timeout_mins time has
expired (see ups_conf(4)). By default the system will power on when the AC line voltage is restored. The kill_after_shutdown line can be
added to to tell the UPS not to come back up when AC line voltage is restored (see ups_conf(4)).
uses the message logging facility to log these occurrences (see syslog(3C)). Messages are written to the console if is unable to send them
to Critical messages (see DIAGNOSTICS section) are also sent to the console.
RETURN VALUE
returns the following values:
zero(0) Successful Completion
non-zero Error encountered. See ERRORS below.
EXAMPLES
The entry in should be similar to this:
DIAGNOSTICS
Messages resulting from normal operation:
Messages resulting in exit of daemon:
Messages for which might be run (depends on UPS configuration):
Messages for which might be run (depends on UPS configuration):
The above messages are followed by the following message:
Messages that are only logged (no action is taken):
Messages relating to Timer Controlled Power On and Off:
ERRORS
returns the following error values:
encountered an incorrect parameter.
Insufficient privileges.
must be started by a superuser.
was interrupted (terminated) by
or See signal(2) and kill(1).
one(1) For all other error conditions.
FILES
SEE ALSO
kill(1), init(1M), plock(2), signal(2), syslog(3C), inittab(4), ups_conf(4).
ups_mond(1M)