07-05-2012
If I knew what to do, don't you think I would have done it? That's why I am asking for input, I am about 1 month into programing. Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How would I pass awk output to a perl variable?
For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct.
$test = system("awk '/NUMBER/{print \$4}' $_"); (8 Replies)
Discussion started by: userix
8 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have a shell script containing a command string in the following format:
command1 | command2 | cut -c9-16
The output from this is a record number (using characters 9-16 of the original output string) e.g. ORD-1234
I wish to save this value to a variable for use in later commands... (4 Replies)
Discussion started by: philjo
4 Replies
3. UNIX for Dummies Questions & Answers
Good morning everyone,
i am looking to know how to save the output of a command and reuse it again within a script
i already tired this one but it didn't work
TEMPDIR=/dir1/dir2
My_command> $TEMPDIR/$TEMPFILE
rm $TEMPDIR/$TEMPFILE*
it keeps saying "cannot write to a... (15 Replies)
Discussion started by: Portabello
15 Replies
4. Shell Programming and Scripting
I am ssh to many servers to get some information... however sometimes the server is unreacheable and i am getting an error. I want to save that output to a file but I am not able to do so...
I want to be able to save output of bash into a file.. so when I run this command on a script
ssh... (5 Replies)
Discussion started by: eponcedeleonc
5 Replies
5. Shell Programming and Scripting
Hi all........
Plss do help me.......in a big trouble... :wall::wall::wall:
I have 3 directories named as :1. /home/shuchi/source
2./home/shuchi/destination
3./home/shuchi/filter
now the problem is /home/shuchi/source has say 2 files with extension .txt as given below :
A.txt
msisdn ... (5 Replies)
Discussion started by: ektubbe
5 Replies
6. Shell Programming and Scripting
Hi Experts,
I am having a requirement like this;
Input file
EIM_ACCT.ifb|1001|1005
EIM_ADDR.ifb|1002|1004
EIM_ABD.ifb|1009|1007
I want to read each line of this file and pass each line,one at a time,as an argument to another script.
eg;
1.read first line->store it to a file->call... (2 Replies)
Discussion started by: ashishpanchal85
2 Replies
7. Shell Programming and Scripting
Hi,
I have some output from 'ls' command and I want to loop over the output in a bash script. What would be a good way to go about it?
For example, if the output of the ls command gives me 'prefix1 prefix2 prefix3', how can I set a loop that will iterate over these?
many thanks! (5 Replies)
Discussion started by: pc2001
5 Replies
8. Shell Programming and Scripting
Hi,
i need help with a file creation of an output program. I've got a program that with #find creates an output for each files in a directory.
If i give this command :
-o spec$(date -u +%Y%m%dt%H%M)
it creates just one file, overwriting all the others since it is the creation date .... (2 Replies)
Discussion started by: Board27
2 Replies
9. Shell Programming and Scripting
Hi,
I am working on a script where I am adding adding colors to few of the info in the output.
Now , after that is done , I see colour codes in log files which I don't want to see.:mad::mad::mad::mad:
So , I tried using sed command in script as below which gives me o/p (new.log) as blank file... (7 Replies)
Discussion started by: Dream4649
7 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I've got a directory of about 6000 txt files that look like this:
a b c d
e f g h
k l m n
I need to execute a command on them to combine them and, in the end, have one big file with all the needed columns taken form all the 6000 files. I've got the "combining" program, but my problem... (26 Replies)
Discussion started by: zajtat
26 Replies
LEARN ABOUT NETBSD
nl_langinfo
NL_LANGINFO(3) BSD Library Functions Manual NL_LANGINFO(3)
NAME
nl_langinfo -- get locale information
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <langinfo.h>
char *
nl_langinfo(nl_item item);
DESCRIPTION
The nl_langinfo() function returns a pointer to a string containing information set by the program's locale.
The names and values of item are defined in <langinfo.h>. The entries under Category indicate in which setlocale(3) category each item is
defined.
Constant Category Meaning
CODESET LC_CTYPE Codeset name
D_T_FMT LC_TIME String for formatting date and time
D_FMT LC_TIME Date format string
T_FMT LC_TIME Time format string
T_FMT_AMPM LC_TIME A.M. or P.M. time format string
AM_STR LC_TIME Ante-meridiem affix
PM_STR LC_TIME Post-meridiem affix
DAY_1 LC_TIME Name of the first day of the week (e.g.: Sunday)
DAY_2 LC_TIME Name of the second day of the week (e.g.: Monday)
DAY_3 LC_TIME Name of the third day of the week (e.g.: Tuesday)
DAY_4 LC_TIME Name of the fourth day of the week (e.g.: Wednesday)
DAY_5 LC_TIME Name of the fifth day of the week (e.g.: Thursday)
DAY_6 LC_TIME Name of the sixth day of the week (e.g.: Friday)
DAY_7 LC_TIME Name of the seventh day of the week (e.g.: Saturday)
ABDAY_1 LC_TIME Abbreviated name of the first day of the week
ABDAY_2 LC_TIME Abbreviated name of the second day of the week
ABDAY_3 LC_TIME Abbreviated name of the third day of the week
ABDAY_4 LC_TIME Abbreviated name of the fourth day of the week
ABDAY_5 LC_TIME Abbreviated name of the fifth day of the week
ABDAY_6 LC_TIME Abbreviated name of the sixth day of the week
ABDAY_7 LC_TIME Abbreviated name of the seventh day of the week
MON_1 LC_TIME Name of the first month of the year
MON_2 LC_TIME Name of the second month
MON_3 LC_TIME Name of the third month
MON_4 LC_TIME Name of the fourth month
MON_5 LC_TIME Name of the fifth month
MON_6 LC_TIME Name of the sixth month
MON_7 LC_TIME Name of the seventh month
MON_8 LC_TIME Name of the eighth month
MON_9 LC_TIME Name of the ninth month
MON_10 LC_TIME Name of the tenth month
MON_11 LC_TIME Name of the eleventh month
MON_12 LC_TIME Name of the twelfth month
ABMON_1 LC_TIME Abbreviated name of the first month
ABMON_2 LC_TIME Abbreviated name of the second month
ABMON_3 LC_TIME Abbreviated name of the third month
ABMON_4 LC_TIME Abbreviated name of the fourth month
ABMON_5 LC_TIME Abbreviated name of the fifth month
ABMON_6 LC_TIME Abbreviated name of the sixth month
ABMON_7 LC_TIME Abbreviated name of the seventh month
ABMON_8 LC_TIME Abbreviated name of the eighth month
ABMON_9 LC_TIME Abbreviated name of the ninth month
ABMON_10 LC_TIME Abbreviated name of the tenth month
ABMON_11 LC_TIME Abbreviated name of the eleventh month
ABMON_12 LC_TIME Abbreviated name of the twelfth month
ERA LC_TIME Era description segments
ERA_D_FMT LC_TIME Era date format string
ERA_D_T_FMT LC_TIME Era date and time format string
ERA_T_FMT LC_TIME Era time format string
ALT_DIGITS LC_TIME Alternative symbols for digits
RADIXCHAR LC_NUMERIC Radix character
THOUSEP LC_NUMERIC Separator for thousands
YESEXPR LC_MESSAGES Affirmative response expression
NOEXPR LC_MESSAGES Negative response expression
RETURN VALUES
nl_langinfo() returns a pointer to an empty string if item is invalid.
EXAMPLES
The following example uses nl_langinfo() to obtain the date and time format for the current locale:
#include <time.h>
#include <langinfo.h>
#include <locale.h>
int main(void)
{
char datestring[100];
struct tm *tm;
time_t t;
char *ptr;
t = time(NULL);
tm = localtime(&t);
(void)setlocale(LC_ALL, "");
ptr = nl_langinfo(D_T_FMT);
strftime(datestring, sizeof(datestring), ptr, tm);
printf("%s
", datestring);
return (0);
}
SEE ALSO
setlocale(3), tm(3), nls(7)
STANDARDS
The nl_langinfo() function conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
The nl_langinfo() function appeared in NetBSD 1.0.
BSD
April 14, 2011 BSD