Sponsored Content
Top Forums Shell Programming and Scripting On how to select the right tool for a given task Post 302248606 by bakunin on Saturday 18th of October 2008 06:01:48 PM
Old 10-18-2008
Quote:
Originally Posted by Perderabo
I really have to agree with cfajohnson. Putting sed in a loop where you process, ...
This is all true, but not the point: cfajohnson claimed that sed is (or should be used) only for files. I challenged that claim by citing that using sed in a pipeline would be a counterexample for an equally sensible use of sed.

Additionally you are correct in assessing the use of any external program in a loop to be expensive in terms of system calls. That doesn't mean it can always be avoided though. Sometimes there is simply no other choice because shell expansion is limited in its possibilities. If your problem can be solved by it, good, if not, you have to resort to some external program with greater capabilities even at the expense of system calls.

bakunin
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

process vs task

Hi, I am new to this forum and unix too. I have just started learning unix. As I was going through the first chapter, I read that unix is multitasking, multiprogramming, multiprocessing and multiuser OS. My question is: Is there any difference between a TASK and a PROCESS. How are PROCESS... (2 Replies)
Discussion started by: hana
2 Replies

2. Shell Programming and Scripting

comment and Uncomment single task out of multiple task

I have a file contains TASK gsnmpproxy { CommandLine = $SMCHOME/bin/gsnmpProxy.exe } TASK gsnmpdbgui { CommandLine = $SMCHOME/bin/gsnmpdbgui.exe I would like to comment and than uncomment specific task eg TASK gsnmpproxy Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies

3. Shell Programming and Scripting

Parse an XML task list to create each task.xml file

I have an task definition listing xml file that contains a list of tasks such as <TASKLIST <TASK definition="Completion date" id="Taskname1" Some other <CODE name="Code12" <Parameter pname="Dog" input="5.6" units="feet" etc /Parameter> <Parameter... (3 Replies)
Discussion started by: MissI
3 Replies

4. Programming

Help with task daemon

believe it or not but this is my first c program (i've worked with java, C#, php though) I am trying to make a daemon that checks if mplayer is running(it's for a projection room) and if it is not then to run mplayer with a file.. So far it's not working and I don't know why Help and comments... (5 Replies)
Discussion started by: james2432
5 Replies

5. Boot Loaders

Reboot and Select Proper Boot device or insert Boot media in select Boot device and press a key

Hello, I have kubuntu on my laptop and now I decided to switch to Windows 7. I made the bios settings properly (first choice is boot from cd\vd) but I see the error " reboot and select proper Boot device or insert Boot media in select Boot device and press a key " I have tried CD and... (0 Replies)
Discussion started by: rpf
0 Replies

6. Shell Programming and Scripting

last task for my script

hi, infile- create table salary ( occupation_code char(40), earnings decimal(10,2), occ_yearend integer ); outfile- salary:create table salary salary:( occupation_code char(40), salary: earnings decimal(10,2), salary: occ_yearend integer salary:); Thanks. (4 Replies)
Discussion started by: dvah
4 Replies

7. Shell Programming and Scripting

task

Hi all, I'm newbie and stuck here. Thanks for any help. Input(txt file) a b X c d Y e f Z g h W Requested output: a b X Y c d Y X e f Z W g h W Z Please use code tags when posting data and code samples! (10 Replies)
Discussion started by: hernand
10 Replies

8. Shell Programming and Scripting

Task

Hi experts, I have a problem with the below shell task: I need to modify the file creatin a paired row , per each row which matches filter (e.g. number of nonempty columns = 5) Output should look like this: second row is original one from the input, first row(red) is pairing row, it's... (29 Replies)
Discussion started by: hernand
29 Replies

9. Homework & Coursework Questions

[HELP] Easy task

I have a simple task for my school work. I'm new with unix, so i need help. I need to write a scenario. Task is. From created txt file read first 3 words and create a 3 catalogs with those 3 words. 2 of those new catalogs should be transferred to other directory. If someone could help me just... (1 Reply)
Discussion started by: justynykas
1 Replies
GROUPS.CONF(5)						     ClusterShell User Manual						    GROUPS.CONF(5)

NAME
groups.conf - Configuration file for ClusterShell external node groups DESCRIPTION
The ClusterShell library obtains node groups configuration options from the system-wide configuration file /etc/clustershell/groups.conf. Additional configuration files are also read from the directories set by the groupsdir option, if present. See the groupsdir option below for further details. Configuration files have a format in the style of RFC 822 potentially composed of several sections which may be present in any order. There are two types of sections: Main and Group source: Main Global configuration options. There should be only one Main section. Group_source The Group_source section(s) define the configuration for each node group source (or namespace). This configuration consists in external commands definition (map, all, list and reverse). Only Group_source section(s) are allowed in additional configuration files. [Main] OPTIONS Configuration parameters of the Main section are described below. default Specify the default group source (group namespace) used by the NodeSet parser when the user does not explicitly specify the group source (eg. "@io"). groupsdir Optional list of directories where the ClusterShell library should look for .conf files which define group sources to use. Each file in these directories with the .conf suffix should contain one or more Group_source sections as documented in [Group_source] options below. These will be merged with the group sources defined in /etc/clustershell/groups.conf to form the complete set of group sources that ClusterShell will use. Duplicate Group_source sections are not allowed. Note: .conf files that are not readable by the current user are ignored. [Group_source] OPTIONS Configuration parameters of each group source section are described below. map Specify the external shell command used to resolve a group name into a nodeset, list of nodes or list of nodeset (separated by space characters or by carriage returns). The variable $GROUP is replaced before executing the command. all Optional external shell command that should return a nodeset, list of nodes or list of nodeset of all nodes for this group source. If not specified, the library will try to resolve all nodes by using the list external command in the same group source followed by map for each group. list Optional external shell command that should return the list of all groups for this group source (separated by space characters or by carriage returns). reverse Optional external shell command used to find the group(s) of a single node. The variable $NODE is previously replaced. If this upcall is not specified, the reverse operation is computed in memory by the library from the list and map external calls. Also, if the number of nodes to reverse is greater than the number of available groups, the reverse external command is avoided automati- cally. When the library executes a group source external shell command, the current working directory is previously set to the corresponding groupsdir. This allows the use of relative paths for third party files in the command. Each external command might return a non-zero return code when the operation is not doable. But if the call return zero, for instance, for a non-existing group, the user will not receive any error when trying to resolve such unknown group. The desired behaviour is up to the system administrator. RESOURCE USAGE
All external command results are cached in memory to avoid multiple calls. EXAMPLES
Simple configuration file for local groups and slurm partitions binding. groups.conf [Main] default: local #groupsdir: /etc/clustershell/groups.conf.d/ [local] map: sed -n 's/^$GROUP:(.*)/1/p' /etc/clustershell/groups list: sed -n 's/^([0-9A-Za-z_-]*):.*/1/p' /etc/clustershell/groups [slurm] map: sinfo -h -o "%N" -p $GROUP all: sinfo -h -o "%N" list: sinfo -h -o "%P" reverse: sinfo -h -N -o "%P" -n $NODE FILES
/etc/clustershell/groups.conf System-wide external node groups configuration file. /etc/clustershell/groups.conf.d/ Recommended directory for additional configuration files. SEE ALSO
clush(1), clubak(1), nodeset(1) http://clustershell.sourceforge.net/ AUTHOR
Stephane Thiell, CEA DAM <stephane.thiell@cea.fr> COPYRIGHT
CeCILL-C V1 1.6 2012-03-31 GROUPS.CONF(5)
All times are GMT -4. The time now is 03:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy