Sponsored Content
Full Discussion: Getting error in while loop
Top Forums Shell Programming and Scripting Getting error in while loop Post 302551864 by jayan_jay on Thursday 1st of September 2011 01:28:25 AM
Old 09-01-2011
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Error in for loop?

Hi, Working on AIX using the following for loop. for a in `find /edi/iTracTEST/sessions -name nohup.out -print` do echo $a done On the command line it works fine, but insert the code in a file and then running it, it does not want to work. I get the following back. ' is not... (3 Replies)
Discussion started by: hugow
3 Replies

2. Shell Programming and Scripting

Error in Loop?

hi friends, i wrote one simple shell script.. in that am using for loop... when i am trying to execute the script.it shows syntax error at for loop line '((' unexpected. #!/bin/ksh ## ##### To find no of files in the directory NOF=`ls -l /root/COMM/LOGS/eds/20081025| wc -l`... (5 Replies)
Discussion started by: rdhaprakasam
5 Replies

3. UNIX for Dummies Questions & Answers

error in for loop???

Hi, I get the following output 98 -1 98 0 ./get_AB04-time: line 79: ((: i< && 0 !=7 : syntax error: operand expected (error token is "&& 0 !=7 ") I have this part of code. Line 79 is the line of the for loop. echo ${OCCURRENCE} $i_START CASE=0; i_END=${i_START}... (4 Replies)
Discussion started by: f_o_555
4 Replies

4. Shell Programming and Scripting

Error Using an if Loop Within a While Loop

Hello All, I am having a problem with an “if loop” within a “while loop” in my Korn Shell program. The basic concept of the program is that it searches for the existence of a series of load files in a load directory, and once it finds one of these files, it begins the following process: · Creates... (4 Replies)
Discussion started by: jonesdk5
4 Replies

5. Shell Programming and Scripting

Error with while loop

the program just prints all the command line arguments Getting error in the program error ./hellow: line 13: 0: command not found ./hellow: line 13: 0: command not found below is the program #!/bin/bash num=$# echo $num if then echo "No arguments are passed ." else ... (7 Replies)
Discussion started by: BHASKARREDDY006
7 Replies

6. Shell Programming and Scripting

Error in while loop

I have a file Table.out having table name like this Table_Emp Table_Exp Table_Fcr To show first 10 rows .. I' wrtng a script like this .. #!/bin/ksh cat /tmp/table.out|while read -r table vbar1 do <connect to db> then select * from $table limit 10; > /tmp/1.out done ... (3 Replies)
Discussion started by: netdbaind
3 Replies

7. Shell Programming and Scripting

Getting error in if loop

Hi All, while executing this code ,I'm gettign below Error if_test: line 3: #!/bin/bash if ; then echo "this is aginity;" elif ; then echo "this is informatica;" fi exit (3 Replies)
Discussion started by: netdbaind
3 Replies

8. Shell Programming and Scripting

Error in loop

This is my first ever bash script. What i wish to achieve is to find all files in current directory except the script file and count lines in each found file. Some thing seems to be wrong with the if statement :confused: Please help why it does not work? and maybe you have some ideas how to improve... (3 Replies)
Discussion started by: chinababy
3 Replies

9. Shell Programming and Scripting

Error in for loop

I was trying to implement a nested for do loop to run a perl script. for i in 1 10 50 do for j in 2 12 55 do perl script.pl "$i" "$i" "$j" done done when I implemented it within a shell script, i got the output, but every time j value will 55, or basically the last value of j in... (10 Replies)
Discussion started by: Kanja
10 Replies

10. UNIX for Beginners Questions & Answers

Error with for loop

There are two files abc_123.dat and abc_345.dat if at least one file exists then enter into the loop and remove file and exit. In first iteration, deleting files successfully but "else" statement executing after deleting files."else" should execute only if there is no file in the directory.... (1 Reply)
Discussion started by: Rajesh123
1 Replies
MSGS(1) 						    BSD General Commands Manual 						   MSGS(1)

NAME
msgs -- system messages and junk mail program SYNOPSIS
msgs [-fhlpq] [number] [-number] msgs [-s] msgs [-c] [-days] DESCRIPTION
The msgs utility is used to read system messages. These messages are sent by mailing to the login `msgs' and should be short pieces of information which are suitable to be read once by most users of the system. The msgs utility is normally invoked each time you login, by placing it in the file .login (or .profile if you use sh(1)). It will then prompt you with the source and subject of each new message. If there is no subject line, the first few non-blank lines of the message will be displayed. If there is more to the message, you will be told how long it is and asked whether you wish to see the rest of the message. The possible responses are: -y Type the rest of the message. RETURN Synonym for y. -n Skip this message and go on to the next message. - Redisplay the last message. -q Drop out of msgs; the next time msgs will pick up where it last left off. -s Append the current message to the file ``Messages'' in the current directory; `s-' will save the previously displayed message. A `s' or `s-' may be followed by a space and a file name to receive the message replacing the default ``Messages''. -m A copy of the specified message is placed in a temporary mailbox and mail(1) is invoked on that mailbox. Both `m' and `s' accept a numeric argument in place of the `-'. The msgs utility keeps track of the next message you will see by a number in the file .msgsrc in your home directory. In the directory /var/msgs it keeps a set of files whose names are the (sequential) numbers of the messages they represent. The file /var/msgs/bounds shows the low and high number of the messages in the directory so that msgs can quickly determine if there are no messages for you. If the con- tents of bounds is incorrect it can be fixed by removing it; msgs will make a new bounds file the next time it is run with the -s option. If msgs is run with any option other than -s, an error will be displayed if /var/msgs/bounds does not exist. The -s option is used for setting up the posting of messages. The line msgs: "| /usr/bin/msgs -s" should be included in /etc/mail/aliases (see newaliases(1)) to enable posting of messages. The -c option is used for performing cleanup on /var/msgs. A shell script entry to run msgs with the -c option should be placed in /etc/periodic/daily (see periodic(8)) to run every night. This will remove all messages over 21 days old. A different expiration may be specified on the command line to override the default. You must be the superuser to use this option. Options when reading messages include: -f Do not say ``No new messages.''. This is useful in a .login file since this is often the case here. -q Queries whether there are messages, printing ``There are new messages.'' if there are. The command ``msgs -q'' is often used in login scripts. -h Print the first part of messages only. -l Cause only locally originated messages to be reported. num A message number can be given on the command line, causing msgs to start at the specified message rather than at the next message indicated by your .msgsrc file. Thus msgs -h 1 prints the first part of all messages. -number Start number messages back from the one indicated in the .msgsrc file, useful for reviews of recent messages. -p Pipe long messages through more(1). Within msgs you can also go to any specific message by typing its number when msgs requests input as to what to do. ENVIRONMENT
The msgs utility uses the HOME and TERM environment variables for the default home directory and terminal type. FILES
/var/msgs/* database ~/.msgsrc number of next message to be presented SEE ALSO
mail(1), more(1), aliases(5), periodic(8) HISTORY
The msgs command appeared in 3.0BSD. BSD
April 28, 1995 BSD
All times are GMT -4. The time now is 11:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy