10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So I'm writing a script which tries to parse human-readable addresses. Part of it is this:
print $2, implode(A,1,AN," "), CITY, PROV, POST, COUNTRY, CITYCOUNT>2;
CITYCOUNT is a variable between 0 and 3 counting the number of words in a city name. I'm trying to prnt 1 wherever that's greater... (5 Replies)
Discussion started by: Corona688
5 Replies
2. UNIX for Dummies Questions & Answers
I almost reach my objective (Youhouuu !!!!)
But I really don't understand why it doesn't work until the end... :wall:
For clarity's sake I am taking a very simple example. The operations I am doing in the script (gsub and print) really don't have any importance !!! I just matter about... (10 Replies)
Discussion started by: beca123456
10 Replies
3. Shell Programming and Scripting
I am struck up with a problem and that is with output redirection.
I used all the ways for the redirection of the output of c binary to a file, still it is failing.
Here are the different ways which I have used:
./a.out | tee -a /root/tmp.txt 2>&1
./a.out | tee -a /root/tmp.txt 1>&1
./a.out |... (2 Replies)
Discussion started by: Maya29988
2 Replies
4. Shell Programming and Scripting
Hi everyone
i am facing a very strange problem . see below is my code
#awk <do something> file 1 > file2
Now the problem is whenever i am redirecting the output to file2 it creates the file2 but of 0 size. i don't know what is the reason but it is very important to me to redirect the... (11 Replies)
Discussion started by: aishsimplesweet
11 Replies
5. Shell Programming and Scripting
I have a system stat command running which generates data after 5 sec or so. I pass this data to awk and do some calculation to present the data differently. Once done now I want to pass this data to file as and when generated but doesn't work..unless the first command completes successfully.... (6 Replies)
Discussion started by: learnscript
6 Replies
6. Shell Programming and Scripting
I'm trying to find average of values in 2nd column in some files. Filenames have following pattern eg:
tau_2.54_even_v1.xls
tau_2.54_odd_v1.xls
tau_1.60_v1.xls
tau_800_v1.xls
#!/bin/bash
for file in pmb_mpi tau xhpl mpi_tile_io fftw ; do
for f in "2.54" "1.60" "800" ;do
if... (2 Replies)
Discussion started by: vishwamitra
2 Replies
7. Shell Programming and Scripting
Hello,
i need to redirect the output of print to a variable file name:
#This is normal
awk '{ print $17 > "output.txt" }' input
#I need something like this
awk '{ print $17 > "output_${25}.txt" }' input
how to format the output file name to contain a variable? (6 Replies)
Discussion started by: nazeeb
6 Replies
8. Shell Programming and Scripting
my querry is
suppose i have duplicate std i/p with FD-3 --exec 0<&3
now redirected std i/p to a file ----exec 0<file1
suppose i am reading the file line by line --while read LINE
cutting some fields and comparing it with a variable and if a match is found
... (0 Replies)
Discussion started by: mobydick
0 Replies
9. Shell Programming and Scripting
I want to run tail -f to continuously monitor a log file, outputing a specific field to a second log file. I can get the first portion to work with the following command:
tail -f log | awk '{if ($1 == "Rough") print $5}'
also:
awk '{if ($1 == "Rough") print $5}' <(tail -f log)
The... (2 Replies)
Discussion started by: mfajer
2 Replies
10. UNIX for Dummies Questions & Answers
Is it possible to sh a command and receive the standard output on the scrren and use file redirection ie ls -lt > test. Also On SCO-UNIX there was a tellme command which displayed a message when a script had finished running is there something similar for HP UNIX as it is not working. (4 Replies)
Discussion started by: namtab
4 Replies