10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Thanks all for taking time out and reading this thread and big Thanks to all who have come forward for rescue.
Background: I have a variable "nbrofcols" that has number of columns from a data file. Now, using this count in for loop, I am trying to get the maximum length of each column present... (7 Replies)
Discussion started by: svks1985
7 Replies
2. UNIX for Dummies Questions & Answers
Hi,
input:
AAA|1
my script (the function is just an example):
gawk 'BEGIN{FS=OFS="|"}
function repeat(str, n, rep, i){
for(i=1; i<=n; i++)
rep=rep str
return rep
}
{
variable_1=repeat($1,$2)
variable_2=repeat($1,$2+1)
variable_3=repeat($1,$2+3)
... (5 Replies)
Discussion started by: beca123456
5 Replies
3. 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
4. Shell Programming and Scripting
Hello,
I'm having some issues getting a home dir from a remote server passed to a variable.
Here is what I have so far:
rsh server "(ls -ld /home*/user | awk '{print \$9}')"
/home3/userThat works fine and brings back what I need.
But when I try to add it to a variable it goes all... (3 Replies)
Discussion started by: elcounto
3 Replies
5. UNIX for Dummies Questions & Answers
Hi i have to insert the below line into a specific line number of another file
export MBR_CNT_PRCP_TYPE_CODES_DEL="'01','02','04','05','49','55','UNK'"
I have passed the above line to a variable say ins_line. I have used below command to perform the insert
awk 'NR==3{print "'"${ins_line}"'"}1'... (1 Reply)
Discussion started by: sathishteradata
1 Replies
6. Shell Programming and Scripting
Hi,
I have a text file with data in that I wish to extract, assign to a variable and process through a loop.
Kind of the process that I am after:
1: Grep the text file for the values.
Currently using:
cat /root/test.txt | grep TESTING= | awk -F"=" '{ a = $2 } {print a}' | sort -u
... (0 Replies)
Discussion started by: Spoonless
0 Replies
7. Shell Programming and Scripting
Hi,
I've tried searching the forums for a case similar to mine but was unsuccessful. This is my first time to use awk so any help would be really appreciated :)
I have one file containing data for with the first value in each row being a State Name. I would need to create a separate file... (1 Reply)
Discussion started by: karver
1 Replies
8. 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
9. Shell Programming and Scripting
Hey all
I have two scripts, one script containing the guts of my code.
The other simply loops through a list, calling the other script on each iteration.
Problem is when I add the line
`/usr/bin/rsh -l root $HOSTNAME ""`
to my main script, the loop never seems to exectute any more... (1 Reply)
Discussion started by: mark007
1 Replies
10. Shell Programming and Scripting
hi
I wanted to use the for loop structure in tandem with rsh command and the result to be redirected into a local .lst file within a shell script .
Tried the following but does not help :confused: .
rsh ABCD "cd /bosp/local/home/linus/;for i in `ls -ltr | grep ^- | awk {'print $9'}`
do... (4 Replies)
Discussion started by: newbee2005
4 Replies