Need equialent command for batch scripts


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need equialent command for batch scripts
# 1  
Old 06-03-2013
Need equialent command for batch scripts

Hi Friend,

what is the equivalent command for batch scripting of tail -1.

for example : i have a.txt file with below the contents. i need to print last line
---------------------------------
Use descriptive thread titles when posting. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or
"Help with Backup Shell Script". Se


output : "Help with Backup Shell Script". Se

Thanks,
Jewel
# 2  
Old 06-03-2013
If your system is setup up normally cron, at, and batch all can run
Code:
tail -1

It WILL NOT appear on your screen. Exactly what command did you use to set up your batch so it will execute ?
# 3  
Old 06-03-2013
i have a .bat file of windows
# 4  
Old 06-03-2013
You mean without using tail -1 you want to see last line as output using some other Unix command/script?

Code:
for i in *.bat
do sed -n '$p' $i
done


Last edited by juzz4fun; 06-03-2013 at 04:41 PM.. Reason: Changed ICODE to CODE
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to write BTEQ batch scripts in UNIX?

Hi All, I need to write Unix shell script. To star with : I need to do some file checking on unix file system, then based on file existance, I need to run diff SQL in Teradata Bteq. After that, depending on Results of SQL, I need to code other shell scripting like moving file, within same... (4 Replies)
Discussion started by: Shilpi Gupta
4 Replies

2. UNIX for Advanced & Expert Users

Batch SFTP command Help

I need to run a test SFTP command in a batch mode and what I need to prompt my password after the sftp userid@hostname. I do not have have an ssh key exchanged between my server and the external server. I only have access to it as an sftp server. I must enter my password in my script. How do i... (2 Replies)
Discussion started by: mrn6430
2 Replies

3. Shell Programming and Scripting

How to batch-processing numerous shell scripts?

How to batch-processing numerous shell scripts? how to record the result of all the scripts as a report? then, I can analysis the process result. I want to process numerous shell scripts in my working directory: the directory name is consistent with shell scripts name, that is to say,... (2 Replies)
Discussion started by: qcmao
2 Replies

4. Shell Programming and Scripting

HowTo translate KSH Scripts to DOS Batch Files ?

Hi there, in near future I have to change my work surrounding from HP UNIX to Windows Vista (great to get rid of old hardware :), but bad to loose UNIX :( ). As I heavily use KSH scripts to do my job, I was wondering, if there is any HowTo available, supporting me in re-writing the scripts to... (4 Replies)
Discussion started by: Joe-K7
4 Replies

5. Windows & DOS: Issues & Discussions

Add password to batch command?

hello, I'd like a batch command to prompt me for a password when I try to use it, and only work if I type in the correct password, can this be done? thanks in advance. (8 Replies)
Discussion started by: Killalot57
8 Replies

6. Shell Programming and Scripting

su command in batch mode

Hi, how do we change user in a shell script- batch mode. Thanks, Rajesh (3 Replies)
Discussion started by: Rajesh Gohad
3 Replies

7. Shell Programming and Scripting

Running shell scripts automatically without using Batch or at commands

I have been trying to run a unix script which contains many sql statements.I need to run this script every monday morning. I tried to run on command prompt, it works fine. But while I run it via batch or at command., it returns with library module could not be loaded (libcompat.1.o could not be... (3 Replies)
Discussion started by: ritzwan0
3 Replies

8. UNIX for Dummies Questions & Answers

How can I run scripts in my unix account from batch file in Windows?

Hi all, I'm working on Windows, connecting to my Unix account by different ways: by FTP opening files in UltraEdit32, by mapping drive to browse, by Exceed or Telnet to compile at Unix account. Actually, that is what I would like to change: I'd like to make a batch file which would connect to... (7 Replies)
Discussion started by: olgafb
7 Replies

9. UNIX for Dummies Questions & Answers

batch command in a shell script

How do I execute a batch command from a script, which "waits" with the next command until the first one has finished? ======= A piece of my script looks like this: #!/bin/sh (...) # run a long batch job: ./run_calculation.sh # then rename resulting file: mv output.dat backup.dat (...) ... (7 Replies)
Discussion started by: ivvo
7 Replies

10. Shell Programming and Scripting

Using Batch command

Hi All I have a need due time constraint to issue the mail command in background. I have a script that sends a message to a mail address as follows :- echo "$MLINE" | mail -s "$HOST - $TEXT" name@co.com & The script runs frequently and I check to see if the script is active and if it is , it... (5 Replies)
Discussion started by: jhansrod
5 Replies
Login or Register to Ask a Question