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. 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
3. Shell Programming and Scripting
Hi Team!!
Please can anyone tell me why the following line does not work properly?
str3+=$str2
it seems that str3 variable does not keep its value in order to be concatenated in the next iteration! Thus when i print the result of the line above it returns the str2 value
What i want to do is to... (8 Replies)
Discussion started by: paladinaeon
8 Replies
4. Shell Programming and Scripting
Hello folks,
I've a (perhaps) simple question.
In a text file I've :
server_name1: directory1
server_name2: directory2
server_name3: directory3
I want to make a loop that lets me connect and operate on every server:
rsh server_name1 "ls -l directory1"
I've tried with awk,... (6 Replies)
Discussion started by: gogol_bordello
6 Replies
5. Shell Programming and Scripting
Hello
I am having issues with a script I'm working on developing on a Solaris machine.
The script is intended to find out how many times a particular user (by given userid) has logged into the local system for more than one hour today.
Here is my while loop:
last $user | grep -v 'sshd'... (7 Replies)
Discussion started by: DaveRich
7 Replies
6. Shell Programming and Scripting
Hi there,
I don't understand the following behavior:
toto:~$ for word in un "deux trois"; do echo $word; done
un
deux trois
toto:~$ sentence='un "deux trois"'
toto:~$ for word in $sentence; do echo $word; done
un
"deux
trois"
toto:~$ sentence="un 'deux trois'"
toto:~$ for word in... (10 Replies)
Discussion started by: chebarbudo
10 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
Hi,
Again a little problem.
Do not understand good why an empty string is not detected.
Here is the program:
#!/bin/ksh
APR=`date | grep Apr | awk '{print $2$3}'`
MAY=`date | grep May | awk '{print $2$3}'`
JUN=`date | grep Jun | awk '{print $2$3}'`
echo "Variable Apr has value:... (6 Replies)
Discussion started by: ejdv
6 Replies
10. Shell Programming and Scripting
Hi,
I have a problem with expending variables when used in a for loop:
#!/bin/ksh
VAR1=aaa
VAR2=bbb
VAR3=ccc
for ITEM in VAR1 VAR2 VAR3
do
echo "${ITEM}"
done
This gives:
VAR1
VAR2
VAR3 (2 Replies)
Discussion started by: ejdv
2 Replies