10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am new to AWK programming. I have the following for loop in my awk program.
cat printhtml.awk:
BEGIN
-------- <some code here>
END{
----------<some code here>
for(N=0; N<H; N++)
{
for(M=5; M<D; M++) print "\t" D "";
}
-----
}
... (2 Replies)
Discussion started by: ctrld
2 Replies
2. UNIX for Dummies Questions & Answers
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff |... (1 Reply)
Discussion started by: Sarita Behera
1 Replies
3. Shell Programming and Scripting
Hi,
I have a situation where I need to create a SQL statement using Unix script for each value in first field (ID). The file looks like this.
Id,TARGET_FIELD_NAME,SOURCE_FIELD_NAME
1,Test_Rate,Field1
1,Test_Factor,Field2
1,Test_Size,Field3
2,Test_Rate,Field4
2,Test_Factor,Field5... (3 Replies)
Discussion started by: kiranredz
3 Replies
4. Shell Programming and Scripting
i am passing input parameter 'one_two' to the script , the script output should display the result as below
one_1two
one_2two
one_3two
if
then
echo " Usage : <$0> <DATABASE> "
exit 0
else
for DB in 1 2 3
do
DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}`
done
fi (5 Replies)
Discussion started by: only4satish
5 Replies
5. Shell Programming and Scripting
Learning, stumbling! My progress in shell scripting is slow. Now I have this doubt:
I have the following file (users.txt):
AU0909,on
AU0309,off
AU0209,on
AU0109,off
And this file (userson.txt)
AU0909
AU0209
AU0109
AU0309
I just want to set those users on userson.txt to "off" in... (14 Replies)
Discussion started by: quinestor
14 Replies
6. Shell Programming and Scripting
I have to replace the pattern found in one file in another file with null/empty "" if found on the fields 3 or 4 ONLY
File 1
====
10604747|Mxdef|9999|9999|9999|2012-03-04 00:00:59
10604747|Mcdef|8888|9999|8888|2012-03-04 00:00:59
.
.
.
File 2
====
9999
8888
.
.
.
Expected... (7 Replies)
Discussion started by: machomaddy
7 Replies
7. Shell Programming and Scripting
I have an for loop that reads the following file
cat param.cfg
val1:env1:opt1
val2:env2:opt2
val3:env3:opt3
val4:env4:opt4
.
.
The for loop extracts the each line of the file so that at any one point, the value of i is
val1:env1:opt1 etc...
I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies
8. Shell Programming and Scripting
Hi,
I am trying to print a specific line in a file through sed or awk. The line number will be passed as a parameter from the previous step. My code looks as below.
TEMP3=`sed -n '$TEMP2p' $FILEPATH/Log.txt`
$TEMP2, I am getting from the previous step which is a numerical value(eg:3).
... (2 Replies)
Discussion started by: satyasrin82
2 Replies
9. Shell Programming and Scripting
Hi All,
I am trying to pass a parameter to AWK on my KSH shell prompt as below.
var1=2
echo $var1
awk -v var2=${var1} '{print var2}' testfile.txt
I am passing the input file (testfile) to awk to get some o/p. It is having 10 records.
When I run AWK, it is throwing the following errors... (1 Reply)
Discussion started by: Raamc
1 Replies
10. Shell Programming and Scripting
I am a newbie to awk and c programming, however am not a unix newbie. However, I do need help with a kshell script I am writing. It is almost complete, the last step is killing me. Any help would be greatly appreciated. What I am trying to do is cat a text file that has usernames. Then, using... (2 Replies)
Discussion started by: synergy_texas
2 Replies