Sponsored Content
Top Forums Shell Programming and Scripting translate a short csh script to bash Post 302452623 by frans on Sunday 12th of September 2010 03:07:45 AM
Old 09-12-2010
PLease, put code tags for your next post.
Code:
# NODES = `cat $HOST_FILE`
NODES=$(cat $HOST_FILE) # no spaces around '=' for a value affectation
# NODELIST = $TMPDIR/namd2.nodelist
NODELIST=$TMPDIR/namd2.nodelist # same as above
echo group main > NODELIST1
for node in $NODES
do
   echo host $node >> $NODELIST
done
# NUMPROCS = 2 * $#NODES
NUMPROCS=$((2 * ${#NODES})) # $(( )) is the construction for arithmetic evaluation

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting bash script to csh

Hi, I'm a beginner in scripting and I recently wrote a bash script that would've worked fine until I realized it needed to be written in csh. Could someone please show me how to correctly change the syntax from bash to csh in this script? Any help will be greatly appreciated. I can provide more... (4 Replies)
Discussion started by: Kweekwom
4 Replies

2. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

3. Shell Programming and Scripting

translate ksh code to csh code

hi all, Can any 1 help me translate this korn shell code to C shell code : email=$(grep "^$1" $folder/config_2.txt | awk '{print $2'}) In config_2.txt the content is : which mean in korn shell , $1=groupname and $2=email address. Now i need to write in C shell script,when i set the... (2 Replies)
Discussion started by: proghack
2 Replies

4. Shell Programming and Scripting

How to run a bash script in csh shell?

Hi how to execute a bash script in csh shell? Thanks (3 Replies)
Discussion started by: rubinovito
3 Replies

5. Shell Programming and Scripting

Need a script to convert csh to bash

Hi, Can anyone give me a script to convert csh to bash? or any key points which can help me to do so as i am new to it. (3 Replies)
Discussion started by: vineet.dhingra
3 Replies

6. Shell Programming and Scripting

Translate csh to ksh

Hi! I need to translate those line in csh (to initialise variable) into ksh construct. Any help would be appreciated! I don't know how to replace them :( Thanks Hulu setenv TestHul "$0 $*" setenv JG `setenvp "JG" "" "$*"` setenv A_1 `setenvp "A_1" "NA" "$*"` Please use next time... (2 Replies)
Discussion started by: patator67
2 Replies

7. Shell Programming and Scripting

Changing script from csh to bash

Hello Guys I have a script working fine on csh, but I would like to change it to bash, how I should change this command to be able to work as bash script. :wall: if ( $fsw > "0" ) then foreach swath ( `awk 'BEGIN {for (i='$fsw';i<='$lsw';i++) printf ("%s\n", i) }'` ) ## work to be done... (2 Replies)
Discussion started by: jiam912
2 Replies

8. Shell Programming and Scripting

Converting awk script from bash to csh

I have the following script set up and working properly in bash. It basically copies a set of lines which match "AS1100002" from one file and replaces the same lines in another file. awk -vN=AS1100002* 'NR==FNR { if($1 ~ N)K=$0; next } { if($1 in K) $0=K; print }' $datadir/file1... (7 Replies)
Discussion started by: ncwxpanther
7 Replies

9. Shell Programming and Scripting

Csh , how to set var value into new var, in short string concatenation

i try to find way to make string concatenation in csh ( sorry this is what i have ) so i found out i can't do : set string_buff = "" foreach line("`cat $source_dir/$f`") $string_buff = string_buff $line end how can i do string concatenation? (1 Reply)
Discussion started by: umen
1 Replies

10. Shell Programming and Scripting

Translate bash mathematical calculation to awk

this code below is very useful in calculating mean and quartiles. however, i would really like to translate it to awk without having to write to any external file: #!/bin/sh filename="tmp.txt" sort -n $1 >$filename rows=`wc -l $filename|cut -d' ' -f1` q2=`echo "($rows+1)/2" |bc` ... (3 Replies)
Discussion started by: SkySmart
3 Replies
CRASHLIST(1)							     CrashMail							      CRASHLIST(1)

NAME
crashlist - Compile a CrashMail nodelist SYNOPSIS
crashlist dir DESCRIPTION
Builds an index for the nodelists in the specified directory (or in the current directory if no directory is specified). To find out what nodelists to read, CrashList uses a file called cmnodelist.prefs in the nodelist directory. The format of this file is as follows: <nodelist name> [<default zone>] As the name of the nodelist, you can either specify the full name of the nodelist or just the base name of the nodelist (without .xxx at the end). If you just specify the base name, CrashList will use the latest nodelist with that name (selected by date, not the extension). A default zone can be used for regional nodelists without a Zone line. All lines beginning with a semicolon are treated as comments. Pointlists should be in BinkleyTerm format and should be specified after the real nodelists. SEE ALSO
crashmail(1), crashgetnode(1) FILES
Example cmnodelist.prefs: ; Configuration for CrashList ; ; Format: <nodelist> [<default zone>] NODELIST BTPOINT AUTHOR
CrashMail is written by Johan Billing <billing@df.lth.se> This manual page was written by Peter Karlsson <peter@softwolves.pp.se> Johan Billing 1999-08-01 CRASHLIST(1)
All times are GMT -4. The time now is 10:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy