Sponsored Content
Top Forums Shell Programming and Scripting Help with improving korn shell script Post 302962894 by RudiC on Sunday 20th of December 2015 03:29:22 PM
Old 12-20-2015
Please use code tags as required by forum rules!

When asking to improve something, it would be nice to supply
- the objective (although quite clear in this case)
- the problem(s) (malfunctions, error msgs, performance issues, ...)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple su - in Korn Shell script

i am trying to do something like this : #!/bin/ksh # Change to the userid user1 su - user1 #Issue the command to change directory and list files cd /home/user1/ ls -lrt exit #Come out of the user1 to root again #change to user 2 su - user2 cd /home/user2/ ls -lrt... (2 Replies)
Discussion started by: furrari
2 Replies

2. UNIX for Dummies Questions & Answers

korn shell script

hello., i have 2 files.. 1 file is in this folder /home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544 (this part) other file is in this folder /home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100 ... (1 Reply)
Discussion started by: pavan_test
1 Replies

3. UNIX Desktop Questions & Answers

korn shell script

hi all i am writing the korn shell script. i have a SQL script which gives me the folowing output DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400 DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400 DSA.WLG.20050711210100.20051025.20050711210100 25881 ... (3 Replies)
Discussion started by: pavan_test
3 Replies

4. AIX

Help with Korn Shell script

I have this Korn shell script that runs via a cron entry. It runs in a loop "watching" a specific file system for files with a certain name. The file system that it is watching is an upload file system for an FTP server. When files that are the correct name come in, it takes the extension of the... (1 Reply)
Discussion started by: heprox
1 Replies

5. Shell Programming and Scripting

Korn Shell script not running

I am sorry, this is really trivial, yet I am not able to understand what the problem is! I am using korn shell and running this script #!/bin/ksh keep=3 while ; do echo $keep keep=$(($keep-1)) done I am getting this error: `keep=$' unexpected I am not able to understand it because ... (1 Reply)
Discussion started by: Asty
1 Replies

6. Solaris

Problems with korn shell script

Hey Guys, I'm looking for some advice about a korn shell script I've written. I've spent hours googling for an answer hopefully someone here can help me out. Basically the part of the script I'm having problems with is when I need to SFTP a file from one server to another. The line looks... (6 Replies)
Discussion started by: hilather
6 Replies

7. Shell Programming and Scripting

Korn Shell Script

I have to solve some exercises in Korn Shell, but i'm having some problems. For example: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. I... (3 Replies)
Discussion started by: burm
3 Replies

8. Homework & Coursework Questions

Korn Shell Script

1. The problem statement, all variables and given/known data: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. 2. Relevant commands, code,... (3 Replies)
Discussion started by: burm
3 Replies

9. Shell Programming and Scripting

running a script in korn shell

I'm learning bash and have discovered that the shell can only work with integers and not decimals. I'd like to run my scripts in korn to account for this, but just now, when I tried to run my script, I got an error message that said 'no such file or directory,' even though when I'm in the shell... (3 Replies)
Discussion started by: Straitsfan
3 Replies

10. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies
MSGS(1) 						    BSD General Commands Manual 						   MSGS(1)

NAME
msgs -- system messages and junk mail program SYNOPSIS
msgs [-fhlpqr] [number] [-number] msgs [-s] msgs [-c [days]] DESCRIPTION
msgs 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. msgs 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. p The specified message is piped through PAGER, or, if PAGER is null or not defined, more(1). The commands `m', `p', and `s' all accept a numeric argument in place of the `-'. msgs 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 contents of bounds is incorrect it can be fixed by removing it; msgs will make a new bounds file the next time it is run. 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. An entry with the -c option should be placed in /etc/crontab 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. Options when reading messages include: -f Do not print ``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. -r Disables the ability to save messages or enter the mailer. It is assumed that PAGER is set to something secure. -l Option causes only locally originated messages to be reported. number 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 PAGER, or, if PAGER is null or not defined, 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
msgs 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) HISTORY
The msgs command appeared in 3.0BSD. BSD
April 28, 1995 BSD
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy