03-11-2019
Hello samthewildone,
I am getting strong feeling from your post that you are looking for *NIX learning, if yes, then:
IMHO, we all should follow famous quote:
You are on right place, this is one of the GREAT forum which I have come across. We have different forums(shell scripting, languages etc etc). Please go to HOME PAGE and you will see all sub forums there, go inside them 1 by 1 and you could learn real time prblems there. OR if you are a lover of Documentations then we have man page sections too where you can go through all command's manual entry and then you could go to forums and read already existing posts and could learn from them.
Trust me when I joined here I didn't know even
ls command, today also I am learning but now at least I know few things and it is all because of UNIX.com.
Do and start reading here. And if you have timings issues(like most of the time I have, office, personal things etc) then also try to grab time in between and do something, make AIM of learning a new command daily(at least 1 command) and evaluate yourself after a month or so and keep doing this until you becoe expert 1 day. I am pretty sure anyone in this world who does HARD WORK it will always be a success.
Our best wishes are with you.
Thanks,
R. Singh
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this:
abc ||| 5e-05 ||| bla
abc ||| 3 ||| ble
def ||| 1 ||| abc
def ||| 0.2 ||| def
As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
Discussion started by: FrancoisCN
1 Replies
2. Shell Programming and Scripting
Hi, all
I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes.
sample input:
for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies
3. Shell Programming and Scripting
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies
4. Shell Programming and Scripting
Hi Freinds,
I have 2 files . one is source.txt and second one is target.txt. I want to keep source.txt as baseline and compare target.txt. please find the data in 2 files and Expected output.
Source.txt
1|HYD|NAG|TRA|34.5|1234
2|CHE|ESW|DES|36.5|134
3|BAN|MEH|TRA|33.5|234... (5 Replies)
Discussion started by: i150371485
5 Replies
5. Linux
I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below:
column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10
"12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Discussion started by: dhruuv369
3 Replies
6. Shell Programming and Scripting
Hello,
I have a text file in the below format:
Source Destination State Lag Status
CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies
7. Shell Programming and Scripting
Table
ACN|NAME|CITY|CTY|NO1|NO2
115|AKKK|ASH|IND|10|15
115|AKKK|ASH|IND|20|20
115|AKKK|ASH|IND|30|35
115|AKKK|ASH|IND|30|35
112|ABC|FL|USA|15|15
112|ABC|FL|USA|25|20
112|ABC|FL|USA|25|45
i have written shell script using cut command
and awk programming getting error correct it and add... (5 Replies)
Discussion started by: udhal
5 Replies
8. Shell Programming and Scripting
I am trying to output a tab-delimited result that uses the data from a tab-delimited file to combine and subtract specific lines.
If $4 matches in each line then the first matching sequential $6 value is added to $2, unless the value is 1, then the original $2 is used (like in the case of line... (3 Replies)
Discussion started by: cmccabe
3 Replies
9. Shell Programming and Scripting
In the awk below I am trying to set/update the value of $14 in file2 in
bold, using the matching NM_ in $12 or $9 in file2
with the NM_ in $2 of file1.
The lengths of $9 and $12 can be variable but what is consistent is the start pattern
will always be NM_ and the end pattern is always ;... (2 Replies)
Discussion started by: cmccabe
2 Replies
10. UNIX for Beginners Questions & Answers
Hi,
So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies
TZSET(3) Linux Programmer's Manual TZSET(3)
NAME
tzset, tzname, timezone, daylight - initialize time conversion information
SYNOPSIS
#include <time.h>
void tzset (void);
extern char *tzname[2];
extern long timezone;
extern int daylight;
DESCRIPTION
The tzset() function initializes the tzname variable from the TZ environment variable. This function is automatically called by the other
time conversion functions that depend on the time zone. In a SysV-like environment it will also set the variables timezone (seconds West
of GMT) and daylight (0 if this time zone does not have any daylight savings time rules, nonzero if there is a time during the year when
daylight savings time applies).
If the TZ variable does not appear in the environment, the tzname variable is initialized with the best approximation of local wall clock
time, as specified by the tzfile(5)-format file localtime found in the system timezone directory (see below). (One also often sees
/etc/localtime used here, a symlink to the right file in the system timezone directory.)
If the TZ variable does appear in the environment but its value is NULL or its value cannot be interpreted using any of the formats speci-
fied below, Coordinated Universal Time (UTC) is used.
The value of TZ can be one of three formats. The first format is used when there is no daylight saving time in the local time zone:
std offset
The std string specifies the name of the time zone and must be three or more alphabetic characters. The offset string immediately follows
std and specifies the time value to be added to the local time to get Coordinated Universal Time (UTC). The offset is positive if the
local time zone is west of the Prime Meridian and negative if it is east. The hour must be between 0 and 24, and the minutes and seconds 0
and 59.
The second format is used when there is daylight saving time:
std offset dst [offset],start[/time],end[/time]
There are no spaces in the specification. The initial std and offset specify the standard time zone, as described above. The dst string
and offset specify the name and offset for the corresponding daylight savings time zone. If the offset is omitted, it defaults to one
hour ahead of standard time.
The start field specifies when daylight savings time goes into effect and the end field specifies when the change is made back to standard
time. These fields may have the following formats:
Jn This specifies the Julian day with n between 1 and 365. February 29 is never counted even in leap years.
n This specifies the Julian day with n between 1 and 365. February 29 is counted in leap years.
Mm.w.d This specifies day d (0 <= d <= 6) of week w (1 <= w <= 5) of month m (1 <= m <= 12). Week 1 is the first week in which day d
occurs and week 5 is the last week in which day d occurs. Day 0 is a Sunday.
The time fields specify when, in the local time currently in effect, the change to the other time occurs. If omitted, the default is
02:00:00.
The third format specifies that the time zone information should be read from a file:
:[filespec]
If the file specification filespec is omitted, the time zone information is read from the file localtime in the system timezone directory,
which nowadays usually is /usr/share/zoneinfo. This file is in tzfile(5) format. If filespec is given, it specifies another
tzfile(5)-format file to read the time zone information from. If filespec does not begin with a `/', the file specification is relative to
the system timezone directory.
FILES
The system time zone directory used depends on the (g)libc version. Libc4 and libc5 use /usr/lib/zoneinfo, and, since libc-5.4.6, when
this doesn't work, will try /usr/share/zoneinfo. Glibc2 will use the environment variable TZDIR, when that exists. Its default depends on
how it was installed, but normally is /usr/share/zoneinfo.
This timezone directory contains the files
localtime local time zone file
posixrules rules for POSIX-style TZ's
Often /etc/localtime is a symlink to the file localtime or to the correct time zone file in the system time zone directory.
CONFORMING TO
SVID 3, POSIX, BSD 4.3
NOTES
Note that the variable daylight does not indicate that daylight savings time applies right now. It used to give the number of some algo-
rithm (see the variable tz_dsttime in gettimeofday(2)). It has been obsolete for many years but is required by SUSv2.
BSD4.3 had a routine char *timezone(zone,dst) that returned the name of the time zone corresponding to its first argument (minutes West of
GMT). If the second argument was 0, the standard name was used, otherwise the daylight savings time version.
SEE ALSO
date(1), gettimeofday(2), time(2), ctime(3), getenv(3), tzfile(5)
2001-11-13 TZSET(3)