10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have 100 files containing different values in single column,
I want to split those files in two separate files (file2 and file3) based on average value of first column of each file,
for those files I am working on the following script
#bin/bash
for memb in $(seq 1 100)
do
awk... (4 Replies)
Discussion started by: dsp80
4 Replies
2. Shell Programming and Scripting
Hello im new here... Im trying to read file and create folders from words in it but i get this for loop error
awk : line 3 : syntax error at or near for
my code is..
#!/bin/bash
begin
for (( i=1;i<=5;i++));
do
awk -v i=$i $0 { print $i }
mkdir $i
done
{print $i}
end {}
i have... (7 Replies)
Discussion started by: boxstep
7 Replies
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
I have written a script which works fine, to remove patterns contained in EXCLUDE.DAT from input.txt
awk 'BEGIN {n=0;while (getline < "EXCLUDE.DAT" > 0){ex=$0;n++}} {for(var in ex){print var "-" ex $0 ;i++}}' input.txt
The last problem I need to solve is how to pass the file... (3 Replies)
Discussion started by: nixie
3 Replies
5. Shell Programming and Scripting
I would like to write a script to extend this command to a general case:
BEGIN {s_0=0;n_0=0}{n_0++;s_0+=($51-$1)^2}END {print sqrt(s_0/n_0)}
i.e. so that
BEGIN {s_0=0;n_0=0}{n_0++;s_0+=($51-$1)^2}END {print sqrt(s_0/n_0)}
BEGIN {s_1=0;n_1=0}{n_1++;s_1+=($51-$2)^2}END {print... (3 Replies)
Discussion started by: chrisjorg
3 Replies
6. Shell Programming and Scripting
This is the final first release of the dynamic menu generator for pekwm (WM).
#!/bin/bash
function param_val {
awk "/^${1}=/{gsub(/^${1}="'/,""); print; exit}' $2
}
echo "Dynamic {"
for CF in `ls -c1 /usr/share/applications/*.desktop`
do
name=$(param_val Name $CF)
... (3 Replies)
Discussion started by: alexscript
3 Replies
7. Shell Programming and Scripting
Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this!
This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
Discussion started by: juampal
9 Replies
8. Shell Programming and Scripting
EDIT: This has been SOLVED. Thanks!
Greetings everyone,
I've posted a few threads with some quick help questions, and this is another one of those. I can't post enough gratitude for those much more knowledgeable than myself who are willing to give good advice for my minor issues. Now,... (2 Replies)
Discussion started by: Eblue562
2 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I'm trying to write a bash script that will query the current system time (OS X 10.6.6) and then convert the output from HH:MM:SS into time in seconds. The output of the system time command (systemsetup -gettime) is returned as:
Time: HH:MM:SS
so I wanted to use awk -F: to grab... (5 Replies)
Discussion started by: xaiu
5 Replies
10. Shell Programming and Scripting
Trying to search a log file for a string, starting from a certain point in the log file. I want to return the number of lines that contain the search string and the total number of lines in the log file. Here's the part of the script I'm having problems with:
set -- $(awk -v... (12 Replies)
Discussion started by: mglenney
12 Replies