Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Hi ,
I have a peculiar case, where my sed command is working on a file which contains lines of small length.
sed "s/XYZ:1/XYZ:3/g" abc.txt > xyz.txt
when abc.txt contains lines of small length(currently around 80 chars) , this sed command is working fine.
when abc.txt contains lines of... (3 Replies)
Hello,
I am checking the length of each line of a fixed length file and making sure all lines are 161 length. My problem is that some files contain null characters which gets stripped out of my echo. How do I have the NULLs included in my check? (and I cannot replace or sub the NULL values with... (10 Replies)
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Hello Everyone,
I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table.
Input Data-
------ ------------------------ ---- -----------------
WFI001 Xxxxxx Control Work Item A Number of Records
------ ------------------------... (5 Replies)
Hello All,
I have this script that does stuff like "starting, stopping & restarting" a Daemon Process running on my machine...
My main question is why in part of my code (which you will see below) does the Array Length (i.e. ${#PIDS} )
return "1" when I know the Array is empty..?
Here is... (17 Replies)
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
LEARN ABOUT REDHAT
confstr
CONFSTR(3) Linux Programmer's Manual CONFSTR(3)NAME
confstr - get configuration dependent string variables
SYNOPSIS
#define _POSIX_C_SOURCE 2
or
#define _XOPEN_SOURCE
#include <unistd.h>
size_t confstr(int name, char *buf, size_t len);
DESCRIPTION
confstr() gets the value of configuration - dependent string variables.
The name argument is the system variable to be queried. The following variables are supported:
_CS_PATH
A value for the PATH variable which indicates where all the POSIX.2 standard utilities can be found.
If buf is not NULL, and len is not zero, confstr() copies the value of the string to buf truncated to len - 1 characters if necessary, with
a null character as termination. This can be detected by comparing the return value of confstr() against len.
If len is zero and buf is NULL, confstr() just returns the value as defined below.
RETURN VALUE
If name does not correspond to a valid configuration variable, confstr() returns 0.
EXAMPLES
The following code fragment determines the path where to find the POSIX.2 system utilities:
char *pathbuf; size_t n;
n = confstr(_CS_PATH,NULL,(size_t)0);
if ((pathbuf = malloc(n)) == NULL) abort();
confstr(_CS_PATH, pathbuf, n);
ERRORS
If the value of name is invalid, errno is set to EINVAL.
CONFORMING TO
proposed POSIX.2
BUGS
POSIX.2 is not yet an approved standard; the information in this manpage is subject to change.
SEE ALSO sh(1), exec(3), system(3)GNU 1993-04-17 CONFSTR(3)