Sponsored Content
Full Discussion: Problem with Ksh scripting
Top Forums Shell Programming and Scripting Problem with Ksh scripting Post 302427592 by fidelis on Monday 7th of June 2010 07:13:31 AM
Old 06-07-2010
Question [Solved] Problem with Ksh scripting

Hi,

Below is the code for my script

Code:
#!/bin/ksh
 
for file in "file1.txt" "file2.txt" "file3.txt" "file4.txt"
do
 L="$(tail -1 $file)"
 NUM=${L%%|*}
 DAT=${L##*|}
 echo $NUM
 echo $DAT
done

Now here,suppose for file1.txt
L will have data like 56|06-07-2010
So, it should be
NUM as 56 & DAT as 06-07-2010

but through the script NUM is getting NULL value and DAT is having 56|06-07-2010 although when am running it without script all works fine...Please tel wher am i wrong..... Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

KSH Scripting

Will a shell script written in shell for HP/UX run on Solaris? (1 Reply)
Discussion started by: dstaller
1 Replies

2. Shell Programming and Scripting

ksh scripting sprintf

is there any sprintf function in korn shell scripting, or anything similar to sprintf? (2 Replies)
Discussion started by: gfhgfnhhn
2 Replies

3. Shell Programming and Scripting

scripting problem ( KSh )

Hi all, I want to find out last word in each line ... suppose my file contains following lines ... this is unix forum here we share knowledge it is very interactive Now i need the output as :- ( the last word od each line ) forum knowledge interactive ... (2 Replies)
Discussion started by: dhananjayk
2 Replies

4. Shell Programming and Scripting

Need help with KSH scripting

Hi I need to insert a page break into a file based on matching a phrase in the file. :confused: I am doing this with a ksh script on a Unix box. Any help would be greatly appreciated. Thanks (5 Replies)
Discussion started by: scrappycc
5 Replies

5. Shell Programming and Scripting

ksh scripting help

I have the file as below server1 no dr aix 5300-05-03 9119-595 20-18888 yes ftp-eagle server2 no dr aix 5300-05-03 9119-595 20-18888 yes ftp-eagle server3 yes dr aix 5300-05-03 9119-595 20-18888 yes ftp-eagle server4 ... (1 Reply)
Discussion started by: praveenbvarrier
1 Replies

6. Shell Programming and Scripting

ksh scripting help needed.

I am trying to create a script to manipulate numerous file and at first I thought it would be a simple task but at this point i am ready to break my computer! I am new to unix scripting so hopefully someone out there thinks this is super easy and can help me out! A sample of the problem file is... (2 Replies)
Discussion started by: theqcup
2 Replies

7. Shell Programming and Scripting

Help with ksh scripting in AIX

I am looking for a script which does the following Script will run daily. 1.It will get snapshot off all filesystems including nfs mounts, automounts and clearcase mounts. 2.Then it will compare new snapshot with the snapshot created in the previous run. 3.If filesystem exists in... (20 Replies)
Discussion started by: saidiya
20 Replies

8. Shell Programming and Scripting

(ksh) problem with scripting

Hello, I have following problem... I have two shell-scripts. The first one is only a script to add Arrays (working very good). In the second script I want to read the Arrays (also working good). I don't know how to explain it... script: #!/usr/bin/ksh . test.sh ... (14 Replies)
Discussion started by: mon5tar
14 Replies

9. Shell Programming and Scripting

ksh scripting

Hi All, Can you please let me know what I missed in the below function? Whenever I try to execute the script i am getting syntax error at line 101 : `fi' unexpected Function is function DELNWE5O { export ORACLE_HOME=/ora00/app/oracle/product/11.2.0/grid_1 export... (9 Replies)
Discussion started by: pvmanikandan
9 Replies

10. Shell Programming and Scripting

KSH scripting

Hi Guys, I am trying to learn to script. first I have 2 server, A and B. A with IP 192.168.82.22. B with IP 192.168.82.44. Both with login user admin and password admin. server A will generate a file every day with name gg.log under /app/gg/20171002.log. I wish to write a script to copy the... (7 Replies)
Discussion started by: leecopper
7 Replies
qmail-queue(8)						      System Manager's Manual						    qmail-queue(8)

NAME
qmail-queue - queue a mail message for delivery SYNOPSIS
qmail-queue DESCRIPTION
qmail-queue reads a mail message from descriptor 0. It then reads envelope information from descriptor 1. It places the message into the outgoing queue for future delivery by qmail-send. The envelope information is an envelope sender address followed by a list of envelope recipient addresses. The sender address is preceded by the letter F and terminated by a 0 byte. Each recipient address is preceded by the letter T and terminated by a 0 byte. The list of recipient addresses is terminated by an extra 0 byte. If qmail-queue sees end-of-file before the extra 0 byte, it aborts without placing the message into the queue. Every envelope recipient address should contain a username, an @ sign, and a fully qualified domain name. qmail-queue always adds a Received line to the top of the message. Other than this, qmail-queue does not inspect the message and does not enforce any restrictions on its contents. However, the recipients probably expect to see a proper header, as described in qmail-header(5). Programs included with qmail which invoke qmail-queue will invoke the contents of $QMAILQUEUE instead, if that environment variable is set. FILESYSTEM RESTRICTIONS
qmail-queue imposes two constraints on the queue structure: each mess subdirectory must be in the same filesystem as the pid directory; and each todo subdirectory must be in the same filesystem as the intd directory. EXIT CODES
qmail-queue does not print diagnostics. It exits 0 if it has successfully queued the message. It exits between 1 and 99 if it has failed to queue the message. All qmail-queue error codes between 11 and 40 indicate permanent errors: 11 Address too long. 31 Mail server permanently refuses to send the message to any recipients. (Not used by qmail-queue, but can be used by programs offering the same interface.) All other qmail-queue error codes indicate temporary errors: 51 Out of memory. 52 Timeout. 53 Write error; e.g., disk full. 54 Unable to read the message or envelope. 55 Unable to read a configuration file. (Not used by qmail-queue.) 56 Problem making a network connection from this host. (Not used by qmail-queue.) 61 Problem with the qmail home directory. 62 Problem with the queue directory. 63 Problem with queue/pid. 64 Problem with queue/mess. 65 Problem with queue/intd. 66 Problem with queue/todo. 71 Mail server temporarily refuses to send the message to any recipients. (Not used by qmail-queue.) 72 Connection to mail server timed out. (Not used by qmail-queue.) 73 Connection to mail server rejected. (Not used by qmail-queue.) 74 Connection to mail server succeeded, but communication failed. (Not used by qmail-queue.) 81 Internal bug; e.g., segmentation fault. 91 Envelope format error. SEE ALSO
addresses(5), envelopes(5), qmail-header(5), qmail-inject(8), qmail-qmqpc(8), qmail-send(8), qmail-smtpd(8) qmail-queue(8)
All times are GMT -4. The time now is 03:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy