I need to read list of machines from a file using foreach loop.
I am trying the follwing, but its not reading the list
foreach i (`cat file.lst | awk '{print $1}'`)
ls -l | grep $i
end
here the file file.lst contains list of files
Any idea whats wrong here
Thanks
Krisyet (2 Replies)
Hi All,
I am facing 'No Match' problem with foreach loop in C shell script.
Initially I tried following grep command showing results properly as shown at the end of the Thread. But foreach command is throwing the error 'No match'.
grep -n Inserted audit_file
foreach insertstr (`grep -n... (0 Replies)
I am scripting in tcsh and here is what I currently have:
foreach group (g1 g2 g3 g4)
set ppl = `cat $group.file.with.list.of.ppl.in.row.format`
set label = 1
@ label += 1
foreach ppls ($ppl)
echo $label >> file
end
end
... (0 Replies)
Hi
I would like foreach to go through a range of numbers 1-365. This input is being read by a compiled fortran program in the same shell script. Let me try an example to clarify
#!/bin/sh
foreach i (1-365)
./data_make program <<EOF
'echo $i'
/data_'echo $i' #output file
I... (10 Replies)
Hi there,
I need some help with a shell script (I'm no sh script expert, but I hope this will explain how I want my script):dir = /home/user/files/
foreach(*.jpg file in $dir) {
tar -cf $file(-.jpg).tar $file;gzip $file(-.jpg).tar
}
mv -f $dir*tar.gz /home/user/pictures/
Thanks for any... (12 Replies)
Hi,
I am trying to create an ssh script to login to cisco routers and activate/deactivate bgp neighbors if they match certain conditions. I dont think my "if" and "foreach" are working correctly. Any help is appreciated. Below is my script:
... (0 Replies)
Hi, I am new here I have used the forums a long time to search for things they are very helpful. I have unfortunately used up all my resources (professors, grad students) and need some help.
I have this very simple piece of code (using to isolate the problem) in a csh script:
#!/bin/csh... (12 Replies)
Hi all,
I have a script which searches for all sql files in the current directory and replaces all sql files with an underscore with a dash. The next part I need to do is record the number of changes made (underscore to dash) and display this value (e.g.2). This is what I have so far;
find /... (17 Replies)
Hi all
I wrote a foreach loop in c-shell:
foreach file (/.../fileNames*)
...
end
The problem is that if there aren't matching files in the directory I'm getting a
"foreach: No match". How can I rewrite it so the script will just skip the loop if there aren't any matching files?
... (4 Replies)
I want to extract data from a ASCII file that looks like the one provided here (see input.txt). For this purpose I used sed commands. I want to chain the sed commands into a script that I can call with custom variables, instead of having to run it multiple times (Need to run the code for 30*24 =... (1 Reply)
Discussion started by: learningtocode
1 Replies
LEARN ABOUT DEBIAN
newinclude
newinclude(1) General Commands Manual newinclude(1)NAME
newinclude - create a binary mailing list from an :include: file
SYNOPSIS
newinclude list
DESCRIPTION
newinclude reads a sendmail-style :include: file, list, and converts it into a binary format in list.bin for use by fastforward.
newinclude first writes the mailing list to list.tmp, and then moves it to list.bin. If there is any problem creating list.tmp, newinclude
leaves list.bin alone.
newinclude always creates list.bin world-readable.
COMPATIBILITY WARNING: sendmail reads list directly; fastforward needs list.bin. sendmail's strategy is a disaster if you save list to
disk at the same moment that sendmail reads it; the list will be truncated at a random spot, perhaps in the middle of an address. Further-
more, if the system crashes while you are writing list, list could be filled with all sorts of garbage.
LIST FORMAT
list may contain any number of lines; each line may contain any number of addresses or further :include: files. See newaliases(1) for
details on the address format. Any line in file beginning with # is ignored.
COMPATIBILITY WARNING: newinclude does not support file or program deliveries in :include: files. You can use the secure delivery mecha-
nisms described in dot-qmail(5) instead.
COMPATIBILITY WARNING: Versions of sendmail before V8 did not allow comments in :include: files.
SEE ALSO fastforward(1), newaliases(1), setmaillist(1), dot-qmail(5)newinclude(1)