10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to add 0393 value at 24th feild using the below command, but its adding at all the lines including header and trailer
Input file:
ZHV|2657|D0217001|T|TXU|Z|PAN|20131112000552||||OPER|
754|52479|
492|489|SP40|1014570286334|20131111|20131201|14355334|CHAMELON... (1 Reply)
Discussion started by: Aditya_001
1 Replies
2. Shell Programming and Scripting
Hi Friends,
I am trying to scan line by line using awk and pull the values and pass it in variables and then will use the variables but doesn't work.
Please see below for details.
#more dbtest.sh
----------------------------------
#!/bin/bash
. $HOME/.bash_profile
while read line
do... (6 Replies)
Discussion started by: narunice
6 Replies
3. 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
4. Shell Programming and Scripting
Hi,
I am using AIX server. I have a korn shell script where in I am redirecting a line to a file in a while loop:
while read line
do
outputline=$line;
echo $outputline >> "./temp/exec_list_"$ETL_JOB_RUN"_temp"
done < ./temp/exec_list_$ETL_JOB_RUN
Sometimes, when the CPU... (2 Replies)
Discussion started by: pmonika
2 Replies
5. 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
6. 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
7. 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
8. 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
9. Shell Programming and Scripting
Hi,
i use awk -F to print three variable delimited by comma $1 $2 $3
if $2=="" i want to extract this information missing from another file using awk -v + some process.
but the problem i can't use the two awk together cause of redirection
there's a solution.
note: i can't use another... (1 Reply)
Discussion started by: kamel.seg
1 Replies
10. 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