03-15-2013
Rather than an alias, create a function for this (this is in korn shell)
k() { str="$1"; pth="$2; grep -i $str $pth ; }
10 More Discussions You Might Find Interesting
1. IP Networking
Hi guys,
I have set up multiple virtual FTP servers on a server through one physical NIC. I believe there are to ways; setting logical or alias ip's. I would like to know what is the difference between setting up a logical ip or setting up an alias ip to a physical network interface? Some links to... (5 Replies)
Discussion started by: zaff
5 Replies
2. UNIX for Dummies Questions & Answers
I am trying to create an alias for a frequently used directory path by using
alias xyz="/proj/dir_name"
and then trying to reach a sub-directoy by using
cd xyz/abc
but I get an error saying " No such file or directory "
plz tell me wats wrong with this ... (3 Replies)
Discussion started by: jasjot31
3 Replies
3. Shell Programming and Scripting
Hi,
Can someone help me with creating a bash shell script.
I need to create a script that gets a positive number n as an argument.
The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies
4. Red Hat
Hi all,
firstly apologies if this is in the wrong category.
I have been making livecds (fedora based) and to change eg the background i use below in the ks file.
this works fine, however when i install the livecd it loses the changes.
How can i make the changes so that they stay when... (5 Replies)
Discussion started by: davewilks
5 Replies
5. Solaris
Hello,
I need the command to create alias for a file "FILE" (NOT for commands) ? And Is there any difference between creating alias for files and creating alias for commands ?
For info, i'm using Solaris 8
Thx,
http://www.unix.com/images/misc/progress.gif (5 Replies)
Discussion started by: newpromo
5 Replies
6. UNIX for Dummies Questions & Answers
If one:
$ find -name 'some expression' -type f > newfile
and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory.
I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies
7. Solaris
Greetings.
I am trying to save a file to a usb from solaris 10.
If I do rmformat, I see my usb, but can't find a location to tell things to save to or figure out how to save/view the files on the disk.
Any help/thoughts/etc would be appreciated.
Thanks!
~K (20 Replies)
Discussion started by: kuriosity_prime
20 Replies
8. Shell Programming and Scripting
I want to create an alias as follows but is not working
alias ../='cd ../' (3 Replies)
Discussion started by: kristinu
3 Replies
9. Homework & Coursework Questions
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:
Here is what I am supposed to do, word for word from my assignment page:
1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies
10. OS X (Apple)
Hi,
I'm using Mac 10.9.1. I would like to create an alias for grep so that it won't print out messages like "grep: /Users/davea/workspace/myproject/subdir/: Is a directory" all the time. So in my terminal, I opened ~/.profile and entered
alias grep='grep -s'
However, when I close and... (5 Replies)
Discussion started by: laredotornado
5 Replies
LEARN ABOUT NETBSD
pthread_getaffinity_np
AFFINITY(3) BSD Library Functions Manual AFFINITY(3)
NAME
pthread_setaffinity_np, pthread_getaffinity_np -- affinity of threads
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
#include <sched.h>
int
pthread_setaffinity_np(pthread_t thread, size_t size, cpuset_t *set);
int
pthread_getaffinity_np(pthread_t thread, size_t size, cpuset_t *set);
DESCRIPTION
Thread affinity allows to run the thread on specified CPU or CPUs only.
The pthread_setaffinity_np() function sets the affinity mask set for thread. At least one valid CPU must be set in the mask.
The pthread_getaffinity_np() function gets the affinity mask of thread into set. Note that set must be created and initialized using the
cpuset(3) functions.
IMPLEMENTATION NOTES
Setting CPU pthread_setaffinity_np requires super-user privileges. Ordinary users can be allowed to control CPU affinity of their threads
via the security.models.extensions.user_set_cpu_affinity sysctl(7). See secmodel_extensions(9).
Portable applications should not use the pthread_setaffinity_np() and pthread_getaffinity_np() functions.
RETURN VALUES
The pthread_setaffinity_np() and pthread_getaffinity_np() functions return 0 on success. Otherwise, an error number is returned to indicate
the error.
EXAMPLES
An example of code fragment, which sets the affinity for the current thread to the CPU whose ID is 0:
cpuset_t *cset;
pthread_t pth;
cpuid_t ci;
cset = cpuset_create();
if (cset == NULL) {
err(EXIT_FAILURE, "cpuset_create");
}
ci = 0;
cpuset_set(ci, cset);
pth = pthread_self();
error = pthread_setaffinity_np(pth, cpuset_size(cset), cset);
if (error) {
...
}
cpuset_destroy(cset);
COMPATIBILITY
Both functions are non-standard extensions.
ERRORS
Both functions may fail if:
[EINVAL] The specified set was invalid.
[EPERM] The calling process lacks the appropriate privileges to perform the operation.
[ESRCH] No thread could be found corresponding to the one specified by thread.
NOTES
There is an alternative processor sets interface, see pset(3). However, thread affinity and processor sets are mutually exclusive, hence
mixing of these interfaces is prohibited.
SEE ALSO
cpuset(3), pset(3), pthread_getschedparam(3), pthread_setschedparam(3), sched(3), schedctl(8)
BSD
December 4, 2011 BSD