10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The bash stores each uniqueid in an array and then passes them to %q to get the unique path. That seems to work what I am having trouble with is renaming each .png with the unique value in %q. I thought it was working but upon closer inspection, a .png file is being sent to scp.... but only 1 and... (21 Replies)
Discussion started by: cmccabe
21 Replies
2. UNIX for Beginners Questions & Answers
I have to append the header (ie "START OF LINE") to a file only if there is data in it.
Below command is showing header though there is no data in a file, can you suggest how to correct..
awk '{NR!=0} BEGIN{print "START OF LINE"}; {print}' file (3 Replies)
Discussion started by: JSKOBS
3 Replies
3. Shell Programming and Scripting
for a in {1..100}
do
awk '{ sum+=$a} END {print sum}' a=$a file1 > file2
done
I know I will get only one number if following the code above, how can I get 100 sum numbers in file2? (2 Replies)
Discussion started by: wanliushao
2 Replies
4. Shell Programming and Scripting
Hi all,
I'm dealing with a bash script to merge the elements of a set of files and counting how many times each element is present. The last field is the file name.
Sample files:
head -5 *.tab==> 3J373_P15Ac1y2_01_LS.tab <==
chr1 1956362 1956362 G A hom ... (7 Replies)
Discussion started by: lsantome
7 Replies
5. Shell Programming and Scripting
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies
6. Shell Programming and Scripting
Hi,
I have one array created and some values are there in ksh. I want to append some other values to it based on some condition in if statement.
#!/bin/ksh
echo "---------------------------------------------------"
set -A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}'... (2 Replies)
Discussion started by: sanzee007
2 Replies
7. Shell Programming and Scripting
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies
8. Shell Programming and Scripting
Hello, I wrote the following in python that parses mathematical expressions and I'm trying to store the results in an array. For example, if I enter 3+4*2, the array should be . Unfortunately, I get the following:
Can anyone help me figure out what is wrong? The tokenizer seems to work... (0 Replies)
Discussion started by: jl487
0 Replies
9. Shell Programming and Scripting
Hi friends,
I have a file with content SOME TEXT HERE
I want to append the string GREAT to Line 1 of my file such that the file content should be
GREAT
SOME TEXT HERE
I can do a cat for the string great and file >> newfile and then rename newfile name to file
But this does not put... (5 Replies)
Discussion started by: dahlia84
5 Replies
10. Shell Programming and Scripting
Hi All,
I have a problem with my awk script. I am trying to append the whole line to another file called " file.txt " but i can't. I suppose there's something wrong in the way that i pipe. I canot use " nawk -f awk_script input > file.txt " because i have a 2nd input.
Can any expert give some... (4 Replies)
Discussion started by: Raynon
4 Replies