Sponsored Content
Top Forums Shell Programming and Scripting Builtin alternatives for several commands? Post 302945494 by Scott on Friday 29th of May 2015 06:27:12 PM
Old 05-29-2015
Instead of mollycoddling Windows folks into using Unix-like tools, why not just teach them a bit of PowerShell?

Go native, why not?!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ASP alternatives

I have just found out that a project I have developed in ASP (ultradev) needs to be migrated to a unix server and won't be able to support asp. Can anyone point me in the right direction to see what my options are with Unix? I have never worked with or developed for a Unix box before. Also,... (3 Replies)
Discussion started by: Ricki
3 Replies

2. UNIX for Advanced & Expert Users

Alternatives for CLOCK_MONOTONIC

Hi, I need to develop timeout functionality in my code, which is not affected by system's time changes.Unfortunately I dont have CLOCK_MONOTONIC support in my OS. Are there any alternatives? (3 Replies)
Discussion started by: amitks21
3 Replies

3. Shell Programming and Scripting

The builtin split function in AWK is too slow

I have a text file that contains 4 million lines, each line contains 2 fields(colon as field separator). as shown: 123:444,555,666,777,888,345 233:5444,555,666,777,888,345 623:454,585,664,773,888,345 ...... Here I have to split the second field(can be up to 40,000 fields) by comma into an... (14 Replies)
Discussion started by: kevintse
14 Replies

4. Red Hat

Alternatives for sudo??

I am looking for an alternative for sudo in linux, where i need not type the password. OR is there any other version of 'growisofs', which can be executed under sudo??? As currently 'growisofs' refuses to start under sudo... Thanks in advance (12 Replies)
Discussion started by: sony star
12 Replies

5. UNIX for Dummies Questions & Answers

Unix Builtin commands

Hi, In unix ls command is found in /bin/ls. Similarly where can I find built-in commands like read, set, unset commands. I found in some couple of websites saying found in bash tool set. In unix everything is considered as a type of file with path. Please can anyone tell me where is that Bash... (5 Replies)
Discussion started by: gwgreen1
5 Replies

6. Shell Programming and Scripting

Sed -f alternatives?

I have a list of items (control file) that I want to substitute in a text file, and it's BIG. The file has two items, the original, and the new: A B B C D E The file has something like 10,000 entries. So in the oldfile.txt, I'd like to basically make all these expression matched... (9 Replies)
Discussion started by: twoblink
9 Replies

7. UNIX for Advanced & Expert Users

SSH alternatives

Hi, I am using SSH to execute unix commands on remote machines. But, SSH will be diabled soon and I am looking for other alternatives to execute remote scripts/commands, without SSH . any suggestions or workarounds with out SSH for remote program executions ? Thanks in advance. (4 Replies)
Discussion started by: talashil
4 Replies

8. Shell Programming and Scripting

Alternatives to Expect

Are there any other alternatives to using Expect script? Can functionality provided by Expect be achieved by any other scripting language? (7 Replies)
Discussion started by: indianya
7 Replies

9. UNIX for Dummies Questions & Answers

Find command alternatives

Hi is there an alternative other than the find command to get the size of files which are 10 days older ? I already use a script with find command find . -mtime +10. However would want to have an alternative script to find the size of files which are over 10 days. Let me know if you... (1 Reply)
Discussion started by: venkidhadha
1 Replies

10. UNIX for Dummies Questions & Answers

Typeset builtin error

I'm attempting to emulate another users .zshrc file. However, I'm sort of confused on what exactly the -g argument does for the typeset builtin. Here's what he has in his .zshrc file: typeset -ga sources sources+="$ZSH_CONFIG/environment.zsh" sources+="$ZSH_CONFIG/options.zsh"... (4 Replies)
Discussion started by: brandontdr
4 Replies
CPU 
binding(3) Hardware Locality (hwloc) CPU binding(3) NAME
CPU binding - Enumerations enum hwloc_cpubind_flags_t { HWLOC_CPUBIND_PROCESS, HWLOC_CPUBIND_THREAD, HWLOC_CPUBIND_STRICT, HWLOC_CPUBIND_NOMEMBIND } Functions int hwloc_set_cpubind (hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags) int hwloc_get_cpubind (hwloc_topology_t topology, hwloc_cpuset_t set, int flags) int hwloc_set_proc_cpubind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags) int hwloc_get_proc_cpubind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags) int hwloc_set_thread_cpubind (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags) int hwloc_get_thread_cpubind (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags) int hwloc_get_last_cpu_location (hwloc_topology_t topology, hwloc_cpuset_t set, int flags) int hwloc_get_proc_last_cpu_location (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags) Detailed Description It is often useful to call hwloc_bitmap_singlify() first so that a single CPU remains in the set. This way, the process will not even migrate between different CPUs. Some operating systems also only support that kind of binding. Note: Some operating systems do not provide all hwloc-supported mechanisms to bind processes, threads, etc. and the corresponding binding functions may fail. -1 is returned and errno is set to ENOSYS when it is not possible to bind the requested kind of object processes/threads. errno is set to EXDEV when the requested cpuset can not be enforced (e.g. some systems only allow one CPU, and some other systems only allow one NUMA node). The most portable version that should be preferred over the others, whenever possible, is hwloc_set_cpubind(topology, set, 0), as it just binds the current program, assuming it is single-threaded, or hwloc_set_cpubind(topology, set, HWLOC_CPUBIND_THREAD), which binds the current thread of the current program (which may be multithreaded). Note: To unbind, just call the binding function with either a full cpuset or a cpuset equal to the system cpuset. On some operating systems, CPU binding may have effects on memory binding, see HWLOC_CPUBIND_NOMEMBIND Running lstopo --top can be a very convenient tool to check how binding actually happened. Enumeration Type Documentation enum hwloc_cpubind_flags_t Process/Thread binding flags. These bit flags can be used to refine the binding policy. The default (0) is to bind the current process, assumed to be single-threaded, in a non-strict way. This is the most portable way to bind as all operating systems usually provide it. Note: Not all systems support all kinds of binding. See the 'Detailed Description' section of CPU binding for a description of errors that can occur. Enumerator: HWLOC_CPUBIND_PROCESS Bind all threads of the current (possibly) multithreaded process. HWLOC_CPUBIND_THREAD Bind current thread of current process. HWLOC_CPUBIND_STRICT Request for strict binding from the OS. By default, when the designated CPUs are all busy while other CPUs are idle, operating systems may execute the thread/process on those other CPUs instead of the designated CPUs, to let them progress anyway. Strict binding means that the thread/process will _never_ execute on other cpus than the designated CPUs, even when those are busy with other tasks and other CPUs are idle. Note: Depending on the operating system, strict binding may not be possible (e.g., the OS does not implement it) or not allowed (e.g., for an administrative reasons), and the function will fail in that case. When retrieving the binding of a process, this flag checks whether all its threads actually have the same binding. If the flag is not given, the binding of each thread will be accumulated. Note: This flag is meaningless when retrieving the binding of a thread. HWLOC_CPUBIND_NOMEMBIND Avoid any effect on memory binding. On some operating systems, some CPU binding function would also bind the memory on the corresponding NUMA node. It is often not a problem for the application, but if it is, setting this flag will make hwloc avoid using OS functions that would also bind memory. This will however reduce the support of CPU bindings, i.e. potentially return -1 with errno set to ENOSYS in some cases. This flag is only meaningful when used with functions that set the CPU binding. It is ignored when used with functions that get CPU binding information. Function Documentation int hwloc_get_cpubind (hwloc_topology_ttopology, hwloc_cpuset_tset, intflags) Get current process or thread binding. Writes into set the physical cpuset which the process or thread (according to flags) was last bound to. int hwloc_get_last_cpu_location (hwloc_topology_ttopology, hwloc_cpuset_tset, intflags) Get the last physical CPU where the current process or thread ran. The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated. int hwloc_get_proc_cpubind (hwloc_topology_ttopology, hwloc_pid_tpid, hwloc_cpuset_tset, intflags) Get the current physical binding of process pid. Note: hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms. HWLOC_CPUBIND_THREAD can not be used in flags. As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID), the binding for that specific thread is returned. int hwloc_get_proc_last_cpu_location (hwloc_topology_ttopology, hwloc_pid_tpid, hwloc_cpuset_tset, intflags) Get the last physical CPU where a process ran. The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated. Note: hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms. HWLOC_CPUBIND_THREAD can not be used in flags. As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID), the binding for that specific thread is returned. int hwloc_get_thread_cpubind (hwloc_topology_ttopology, hwloc_thread_tthread, hwloc_cpuset_tset, intflags) Get the current physical binding of thread tid. Note: hwloc_thread_t is pthread_t on Unix platforms, and HANDLE on native Windows platforms. HWLOC_CPUBIND_PROCESS can not be used in flags. int hwloc_set_cpubind (hwloc_topology_ttopology, hwloc_const_cpuset_tset, intflags) Bind current process or thread on cpus given in physical bitmap set. Returns: -1 with errno set to ENOSYS if the action is not supported -1 with errno set to EXDEV if the binding cannot be enforced int hwloc_set_proc_cpubind (hwloc_topology_ttopology, hwloc_pid_tpid, hwloc_const_cpuset_tset, intflags) Bind a process pid on cpus given in physical bitmap set. Note: hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms. HWLOC_CPUBIND_THREAD can not be used in flags. int hwloc_set_thread_cpubind (hwloc_topology_ttopology, hwloc_thread_tthread, hwloc_const_cpuset_tset, intflags) Bind a thread thread on cpus given in physical bitmap set. Note: hwloc_thread_t is pthread_t on Unix platforms, and HANDLE on native Windows platforms. HWLOC_CPUBIND_PROCESS can not be used in flags. Author Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. Version 1.4.1 Mon Feb 27 2012 CPU binding(3)
All times are GMT -4. The time now is 11:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy