Sponsored Content
Top Forums Shell Programming and Scripting Help me for using the awk command in UNIX Post 302784679 by DGPickett on Friday 22nd of March 2013 04:48:32 PM
Old 03-22-2013
Well, he said he wanted to do it inside awk. Does he want the day number of last friday or the last friday of the given month? I get confused so easy some days! Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK : read unix command

Hi, Is there a way to have something working like the read Unix command to stop a awk ask a question and get the result. I've try system("read a") but it does not work. Thanks. Franck. (6 Replies)
Discussion started by: fwirbel
6 Replies

2. Shell Programming and Scripting

How to convert unix command into Awk statement

Hi all, How can i use the below unix command in AWK . Can any one please suggest me how i can use. sed -e "s/which first.sh/which \$0/g" $shell > $shell.sal where $0=current program name(say current.sh) $shell=second.sh (1 Reply)
Discussion started by: krishna_gnv
1 Replies

3. Shell Programming and Scripting

assign a command line argument and a unix command to awk variables

Hi , I have a piece of code ...wherein I need to assign the following ... 1) A command line argument to a variable e.g origCount=ARGV 2) A unix command to a variable e.g result=`wc -l testFile.txt` in my awk shell script When I do this : print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies

4. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

5. UNIX for Advanced & Expert Users

awk sub command in Unix

Hi, I am new to unix shell script and I have some trouble on the awk sub I would like to pick the Date "July 10 2012" into $corr_date by using sub() function, but it is not successful. The inputted text file: pic.*.txt July 10 2012 20:30:50 , 1234567.jpg July 10 2012 20:30:52 , 5648978.jpg... (1 Reply)
Discussion started by: meroko
1 Replies

6. Shell Programming and Scripting

If else condition inside for loop of awk command in UNIX shell scripting

Hi , Please excuse me for opening a new thread i am unable to find out the syntax error in my if else condition inside for loop in awk command , my actual aim is to print formatted html td tag when if condition (True) having string as "failed", could anyone please advise what is the right... (2 Replies)
Discussion started by: karthikram
2 Replies

7. Shell Programming and Scripting

awk command to manipulate csv file in UNIX

Hi, I am new to awk/unix and am trying to put together a script to manipulate the date column in a csv file. I have file1.csv with the following contents: Date,ID,Number,Amount,Volume,Size 01-Apr-2014,WERFG,998,105873.96,10873.96,1342.11 01-Apr-2014,POYFR,267,5681.44,5681.44,462.96 I... (2 Replies)
Discussion started by: Prit Siv
2 Replies

8. Shell Programming and Scripting

awk command to manipulate csv file in UNIX

Hi, I am new to awk and unix programming and trying to manipulate a csv file. My current csv file looks like this: col1,col2,col3,col4,col5,col4,col5,col6,col7,col8 223,V,c,2,4,f,r,,y,z 223,V,c,3,2,f,r,,y,z 223,V,c,1,4,f,r,,y,z 223,V,c,4,3,f,r,,y,z 227,V,c,3,1,f,r,,y,z... (8 Replies)
Discussion started by: Prit Siv
8 Replies

9. UNIX for Beginners Questions & Answers

awk command to retrieve record 23 and 89 from UNIX file

Hi Everyone, I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file? Please let me know what is the awk command for this? Regards Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies

10. Homework & Coursework Questions

awk command to retrieve record 23 and 89 from UNIX file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file?... (6 Replies)
Discussion started by: rakeshp
6 Replies
CALENDAR_CONF(5)					   Sun Grid Engine File Formats 					  CALENDAR_CONF(5)

NAME
calendar_conf - Sun Grid Engine calendar configuration file format DESCRIPTION
calendar_conf reflects the format of the Sun Grid Engine calendar configuration. The definition of calendars is used to specify "on duty" and "off duty" time periods for Sun Grid Engine queues on a time of day, day of week or day of year basis. Various calendars can be imple- mented and the appropriate calendar definition for a certain class of jobs can be attached to a queue. calendar_conf entries can be added, modified and displayed with the -Acal, -acal, -Mcal, -mcal, -scal and -scall options to qconf(1) or with the calendar configuration dialog of the graphical user interface qmon(1). Note, Sun Grid Engine allows backslashes () be used to escape newline ( ewline) characters. The backslash and the newline are replaced with a space (" ") character before any interpretation. FORMAT
calendar_name The name of the calendar to be used when attaching it to queues or when administering the calendar definition. See calendar_name in sge_types(1) for a precise definition of valid calendar names. year The queue status definition on a day of the year basis. This field generally will specify on which days of a year (and optionally at which times on those days) a queue, to which the calendar is attached, will change to a certain state. The syntax of the year field is defined as follows: year:= { NONE | year_day_range_list=daytime_range_list[=state] | year_day_range_list=[daytime_range_list=]state | state} Where o NONE means, no definition is made on the year basis o if a definition is made on the year basis, at least one of year_day_range_list, daytime_range_list and state always have to be present, o all day long is assumed if daytime_range_list is omitted, o switching the queue to "off" (i.e. disabling it) is assumed if state is omitted, o the queue is assumed to be enabled for days neither referenced implicitly (by omitting the year_day_range_list) nor explicitly and the syntactical components are defined as follows: year_day_range_list := {yearday-yearday|yearday},... daytime_range_list := hour[:minute][:second]- hour[:minute][:second],... state := {on|off|suspended} year_day := month_day.month.year month_day := {1|2|...|31} month := {jan|feb|...|dec|1|2|...|12} year := {1970|1971|...|2037} week The queue status definition on a day of the week basis. This field generally will specify on which days of a week (and optionally at which times on those days) a queue, to which the calendar is attached, will change to a certain state. The syntax of the week field is defined as follows: week:= { NONE | week_day_range_list[=daytime_range_list][=state] | [week_day_range_list=]daytime_range_list[=state] | [week_day_range_list=][daytime_range_list=]state} ... Where o NONE means, no definition is made on the week basis o if a definition is made on the week basis, at least one of week_day_range_list, daytime_range_list and state always have to be present, o every day in the week is assumed if week_day_range_list is omitted, o syntax and semantics of daytime_range_list and state are identical to the definition given for the year field above, o the queue is assumed to be enabled for days neither referenced implicitly (by omitting the week_day_range_list) nor explicitly and where week_day_range_list is defined as week_day_range_list := {weekday-weekday|weekday},... week_day := {mon|tue|wed|thu|fri|sat|sun} with week_day ranges the week_day identifiers must be different. SEMANTICS
Successive entries to the year and week fields (separated by blanks) are combined in compliance with the following rule: o "off"-areas are overridden by overlapping "on"- and "suspended"-areas and "suspended"-areas are overridden by "on"-areas. Hence an entry of the form week 12-18 tue=13-17=on means that queues referencing the corresponding calendar are disabled the entire week from 12.00-18.00 with the exception of Tuesday between 13.00-17.00 where the queues are available. o Area overriding occurs only within a year/week basis. If a year entry exists for a day then only the year calendar is taken into account and no area overriding is done with a possibly conflicting week area. o the second time specification in a daytime_range_list may be before the first one and treated as expected. Thus an entry of the form year 12.03.2004=12-11=off causes the queue(s) be disabled 12.03.2004 from 00:00:00 - 10:59:59 and 12:00:00 - 23:59:59. EXAMPLES
(The following examples are contained in the directory $SGE_ROOT/util/resources/calendars). o Night, weekend and public holiday calendar: On public holidays "night" queues are explicitly enabled. On working days queues are disabled between 6.00 and 20.00. Saturday and Sun- day are implicitly handled as enabled times: calendar_name night year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999=on week mon-fri=6-20 o Day calendar: On public holidays "day"-queues are disabled. On working days such queues are closed during the night between 20.00 and 6.00, i.e. the queues are also closed on Monday from 0.00 to 6.00 and on Friday from 20.00 to 24.00. On Saturday and Sunday the queues are disabled. calendar_name day year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999 week mon-fri=20-6 sat-sun o Night, weekend and public holiday calendar with suspension: Essentially the same scenario as the first example but queues are suspended instead of switching them "off". calendar_name night_s year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999=on week mon-fri=6-20=suspended o Day calendar with suspension: Essentially the same scenario as the second example but queues are suspended instead of switching them "off". calendar_name day_s year 1.1.1999,6.1.1999,28.3.1999,30.3.1999- 31.3.1999,18.5.1999-19.5.1999,3.10.1999,25.12.1999,26 .12.1999=suspended week mon-fri=20-6=suspended sat-sun=suspended o Weekend calendar with suspension, ignoring public holidays: Settings are only done on the week basis, no settings on the year basis (keyword "NONE"). calendar_name weekend_s year NONE week sat-sun=suspended SEE ALSO
sge_intro(1), sge__types(1), qconf(1), queue_conf(5). COPYRIGHT
See sge_intro(1) for a full statement of rights and permissions. SGE 6.2u5 $Date$ CALENDAR_CONF(5)
All times are GMT -4. The time now is 11:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy