Sponsored Content
Homework and Emergencies Homework & Coursework Questions expr to translate the date command Post 302501180 by linuxtraining on Wednesday 2nd of March 2011 09:46:38 PM
Old 03-02-2011
I got it. It was pretty easy once I took a minuet to look over the code but now I'm trying to at a argument and assign it to a perimeter where it has to be a number. like 1-24 but i get errors.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

expr command

I am looking for the correct syntax on the expr command in UNIX. I have a script that I am building at the moment. the script is creating file1 that is an actual .sql file that is going inside the oracle database to get some information in there. It take that information, puts it inside another... (2 Replies)
Discussion started by: wolf
2 Replies

2. UNIX for Advanced & Expert Users

Translate date value to normal date and backwards.

Hello, How do i translate datevalues in unix to normal dates. and how do i translate normal dates in to datevalues. I'm using the unix-date. Sample: 1067949360 to 4-11-03 12:36 and 4-11-03 12:36 to 1067949360 I want to built a script with a question to the user: give in date... (4 Replies)
Discussion started by: Frederik
4 Replies

3. Shell Programming and Scripting

date=`/usr/ucb/expr $date1 - 1`

Hi I need to subtract one day from date1=`/bin/date +%d` So I used date=`/usr/ucb/expr $date1 - 1` The only thing is if date1 is a single digit like 08, date will be 8 instead of 08. How can I avoid losing 0? Thanks for all your help!!! (4 Replies)
Discussion started by: whatisthis
4 Replies

4. UNIX for Dummies Questions & Answers

expr command

hi guys.... i hava a command expr... where i m adding a value in a loop like Tc=`expr $Tc\+ $l` where Tc is declred as a variable and every time l contains a new vaue if Tc =0 initially and l =2 Tc should be equal to 0+ 2 and then l = 4 Tc = 2+4 and dispaly as 6 but after... (5 Replies)
Discussion started by: madhu_aqua14
5 Replies

5. UNIX for Dummies Questions & Answers

using the expr command

Hi friends how can i execute expr $va1 * $var2 provided i m not supposed to use '/' also the nglob variable is turned off. (4 Replies)
Discussion started by: ashishj
4 Replies

6. Shell Programming and Scripting

Translate decimal into date

Hello, what can I do to convert a decimal number (001-366) into the day of the year it represent in the format of mm-dd-yyyy ? I know about the date +%j, it gives me the number for the current date, what about a reverse of this, is there such a thing? My number resides in a var, what can I do to... (3 Replies)
Discussion started by: gio001
3 Replies

7. Shell Programming and Scripting

expr command

Hi Can anyone explain me the usage of this command and the arguments used here and what will be the expected output : v_num=`expr nav_d_20100204_1759 : '*\(*\)'` what will be the value returned in v_num. Thanks in Advance!!! Regards Naveen Purbia (3 Replies)
Discussion started by: trying_myluck
3 Replies

8. Shell Programming and Scripting

expr command help

I'm trying to check if a variable'd string is only one character and use that in an if statement the only way I could find is: $expr "${var}" : . # expr STRING : regrep where the "." is the grep wildcard for any single character. Whats wrong with my code here and is there a... (3 Replies)
Discussion started by: Tewg
3 Replies

9. UNIX for Dummies Questions & Answers

How to translate multiple spaces into a single space using tr command?

I am trying to read a txt file and trying to translate multiples spaces into single spaces so the file is more organized, but whenever I try the command: tr ' ' ' ' w.txt The output is: tr: extra operand `w.txt' Try `tr --help' for more information. Can someone please help? :wall: ... (2 Replies)
Discussion started by: Nonito84
2 Replies

10. Shell Programming and Scripting

Use of tr command to translate after 1st character of each line in a file

Hello, I have an input file contaning following data: < 12345;5454;77;qwert< yuyuy;ruwuriwru> yyyw; > 35353;68686;424242;hrjwhrwrwy< dgdgd; I have first character as '<' or '>'and after that one space is their in each line I just want to replace 1st space encountered after < or >... (3 Replies)
Discussion started by: abhi001cse
3 Replies
mt-streams(9F)						   Kernel Functions for Drivers 					    mt-streams(9F)

NAME
mt-streams - STREAMS multithreading SYNOPSIS
#include <sys/conf.h> INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). DESCRIPTION
STREAMS drivers configures the degree of concurrency using the cb_flag field in the cb_ops structure (see cb_ops(9S)). The corresponding field for STREAMS modules is the f_flag in the fmodsw structure. For the purpose of restricting and controlling the concurrency in drivers/modules, we define the concepts of inner and outer perimeters. A driver/module can be configured either to have no perimeters, to have only an inner or an outer perimeter, or to have both an inner and an outer perimeter. Each perimeter acts as a readers-writers lock, that is, there can be multiple concurrent readers or a single writer. Thus, each perimeter can be entered in two modes: shared (reader) or exclusive (writer). The mode depends on the perimeter configuration and can be different for the different STREAMS entry points ( open(9E), close(9E), put(9E), or srv(9E)). The concurrency for the different entry points is (unless specified otherwise) to enter with exclusive access at the inner perimeter (if present) and shared access at the outer perimeter (if present). The perimeter configuration consists of flags that define the presence and scope of the inner perimeter, the presence of the outer perime- ter (which can only have one scope), and flags that modify the default concurrency for the different entry points. All MT safe modules/drivers specify the D_MP flag. Inner Perimeter Flags The inner perimeter presence and scope are controlled by the mutually exclusive flags: D_MTPERQ The module/driver has an inner perimeter around each queue. D_MTQPAIR The module/driver has an inner perimeter around each read/write pair of queues. D_MTPERMOD The module/driver has an inner perimeter that encloses all the module's/driver's queues. None of the above The module/driver has no inner perimeter. Outer Perimeter Flags The outer perimeter presence is configured using: D_MTOUTPERIM In addition to any inner perimeter, the module/driver has an outer perimeter that encloses all the mod- ule's/driver's queues. This can be combined with all the inner perimeter options except D_MTPERMOD. Note that acquiring exclusive access at the outer perimeter (that is, using qwriter(9F) with the PERIM_OUTER flag) can incur significant performance penalties, which grow linearly with the number of open instances of the module or driver in the system. The default concurrency can be modified using: D_MTPUTSHARED This flag modifies the default behavior when put(9E) procedure are invoked so that the inner perimeter is entered shared instead of exclusively. D_MTOCEXCL This flag modifies the default behavior when open(9E) and close(9E) procedures are invoked so the the outer perime- ter is entered exclusively instead of shared. Note that drivers and modules using this flag can cause significant system performance degradation during stream open or close when many instances of the driver or module are in use simultaneously. For this reason, use of this flag is discouraged. Instead, since open(9E) and close(9E) both execute with user context, developers are encour- aged to use traditional synchronization routines such as cv_wait_sig(9F) to coordinate with other open instances of the module or driver. The module/driver can use qwait(9F) or qwait_sig() in the open(9E) and close(9E) procedures if it needs to wait "outside" the perimeters. The module/driver can use qwriter(9F) to upgrade the access at the inner or outer perimeter from shared to exclusive. The use and semantics of qprocson() and qprocsoff(9F) is independent of the inner and outer perimeters. SEE ALSO
close(9E), open(9E), put(9E), srv(9E), qprocsoff(9F), qprocson(9F), qwait(9F), qwriter(9F), cb_ops(9S) STREAMS Programming Guide Writing Device Drivers SunOS 5.10 16 Dec 2002 mt-streams(9F)
All times are GMT -4. The time now is 05:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy