Hello all,
I would like a message to be displayed on the shell when someone opens up the terminal - something like a welcome msg with date and time. I know how to do this by running the shell commands but dont know how to display it when a user opens up the terminal?
Thanks in advance (27 Replies)
Hello,
I am teaching myself shell scripting and I was wondering if there was a way to rename a file and display a warning or prompt message? And if you had a file like
/home/me/blah/ for example, what are the ways to use the CD to get to /me?
Would it be ../home/me? Are there other ways to... (4 Replies)
Can anyone point me to the right direction on how to write a simple script that will display a message on any terminal when implemented?
Basically I need it so the script runs at a certain time, say April 30, 2010 and that the message will be displayed to me no matter which terminal I am logged... (2 Replies)
Hi guys,
I have a script that call another, the other displays de message and I can print directly to the flat file, but in one command I am searchig that this message can be displayed in the screen and in the flat file in one command.
I am doing something like this:
var=$(./Example.sh)... (2 Replies)
Hi i'm new to the forum and was hoping someone could help me with the following query.
I do alot of testing and have hundreds of log files output. I have a script (someone else wrote) which finds all the passed and failed logs and puts a number in a column onto a webpage:
e.g:
Pass ... (4 Replies)
Hi,
I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg.
"this is the line1"
"this is the line2"
The yyy.txt with lot of lines. eg:
"This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
Hello
i have to perform a sftp from server "A" to server "B"(remote server).
when i execute the sftp command it prompts for password.
right now we haven't establish the ssh key exchange so we have to dispaly a error message if it prompts for password.
how can i perform it please help (0 Replies)
Basically, I want to copy all files (F03*) in this directory and merge/paste them into a new file (called SMER_2.03.12.SPU), yet the error message is "no such file or directory." I listed what is in my working directory, and the files do exist, so I'm not sure what's going on. The code's at the... (8 Replies)
I'm have a script that I am creating and I want the dmesg command to only show output for the current day and the day before. What would be the command to make this work?
Thanks (8 Replies)
Hi All,
I am working with a XML file.
Below is part for the file.
<Emp:Profile>
<Emp:Description>Admin</Emp:Description>
<Emp:Id>12347</Emp:Id>
</Emp:Profile>
<Emp:Profile>
... (7 Replies)
Discussion started by: Girish19
7 Replies
LEARN ABOUT POSIX
bus_alloc_resource
BUS_ALLOC_RESOURCE(9) BSD Kernel Developer's Manual BUS_ALLOC_RESOURCE(9)NAME
bus_alloc_resource, bus_alloc_resource_any -- allocate resources from a parent bus
SYNOPSIS
#include <sys/param.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
struct resource *
bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
struct resource *
bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags);
DESCRIPTION
This is an easy interface to the resource-management functions. It hides the indirection through the parent's method table. This function
generally should be called in attach, but (except in some rare cases) never earlier.
The bus_alloc_resource_any() function is a convenience wrapper for bus_alloc_resource(). It sets the values for start, end, and count to the
default resource (see description of start below).
The arguments are as follows:
dev is the device that requests ownership of the resource. Before allocation, the resource is owned by the parent bus.
type is the type of resource you want to allocate. It is one of:
SYS_RES_IRQ for IRQs
SYS_RES_DRQ for ISA DMA lines
SYS_RES_IOPORT for I/O ports
SYS_RES_MEMORY for I/O memory
rid points to a bus specific handle that identifies the resource being allocated. For ISA this is an index into an array of resources that
have been setup for this device by either the PnP mechanism, or via the hints mechanism. For PCCARD, this is an index into the array of
resources described by the PC Card's CIS entry. For PCI, the offset into pci config space which has the BAR to use to access the resource.
The bus methods are free to change the RIDs that they are given as a parameter. You must not depend on the value you gave it earlier.
start and end are the start/end addresses of the resource. If you specify values of 0ul for start and ~0ul for end and 1 for count, the
default values for the bus are calculated.
count is the size of the resource. For example, the size of an I/O port is usually 1 byte (but some devices override this). If you speci-
fied the default values for start and end, then the default value of the bus is used if count is smaller than the default value and count is
used, if it is bigger than the default value.
flags sets the flags for the resource. You can set one or more of these flags:
RF_ALLOCATED resource has been reserved. The resource still needs to be activated with bus_activate_resource(9).
RF_ACTIVE activate resource atomically.
RF_SHAREABLE resource permits contemporaneous sharing. It should always be set unless you know that the resource cannot be shared. It is
the bus driver's task to filter out the flag if the bus does not support sharing. For example, pccard(4) cannot share IRQs
while cardbus(4) can.
RF_TIMESHARE resource permits time-division sharing.
RETURN VALUES
A pointer to struct resource is returned on success, a null pointer otherwise.
EXAMPLES
This is some example code that allocates a 32 byte I/O port range and an IRQ. The values of portid and irqid should be saved in the softc of
the device after these calls.
struct resource *portres, *irqres;
int portid, irqid;
portid = 0;
irqid = 0;
portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &portid,
0ul, ~0ul, 32, RF_ACTIVE);
irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqid,
RF_ACTIVE | RF_SHAREABLE);
SEE ALSO bus_activate_resource(9), bus_release_resource(9), device(9), driver(9)AUTHORS
This manual page was written by Alexander Langer <alex@big.endian.de> with parts by Warner Losh <imp@FreeBSD.org>.
BSD May 18, 2000 BSD