unix batch


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers unix batch
# 1  
Old 06-30-2001
Data unix batch

I´m new to unix so i´m sure this is a simple question for most of you. I want to know how to write a batch file for unix commands. for example, i want to be able to run the pine program by simply typing in p on the command line instead of spelling out the whole word.

thanks
# 2  
Old 06-30-2001
Which shell are you using?

It might be easier to create an alias for pine if your shell supports aliases.

For the bash shell you could put the following into your .bashrc file located in your home directory:

alias p='/usr/bin/pine'

Alternatively a shell script to execute the same thing:

#!/bin/sh

sh /usr/bin/pine

Andy Hibbins
Smilie

removed excessive blank lines for readability --oombera

Last edited by oombera; 02-18-2004 at 11:19 AM..
# 3  
Old 06-30-2001
my default shell is csh, i think. mainly cuz there is no .bashrc in my root dir, but there is a .cshrc
this is what i put in the .cshrc file that you told me but it still doesn´t work. and how do we make a shell script? i have no idea how to do it. i typed in the command u gave me but it gives me an event error.
Code:
###############################################################################
#
# .cshrc - This is a multi-platform user environment start-up file for
#        csh and tcsh instances.
#
# PLEASE DO NOT EDIT THIS FILE!  For information see /usr/local/dotfiles/README
#
###############################################################################


if ( -r /etc/env.path ) then
        set ENVPATH=`cat /etc/env.path`
else
        set ENVPATH="sun"
endif
set TARGET=.cshrc

alias p='/usr/bin/pine'

#

added code tags for readability --oombera

Last edited by oombera; 02-18-2004 at 11:19 AM..
# 4  
Old 06-30-2001
Change your shell to bash by using chsh or maybe editing the /etc/passwd file.

My .bashrc file looks like the following:
Code:
# ~/.bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

if [ -z "$PROFILE_LOADED" -a -e /etc/profile ]; then
    . /etc/profile
fi
alias mail='pine'
alias neton='ifup ppp0 &'
alias netoff='ifdown ppp0 &'
unset PROFILE_LOADED

# For some unknown reason bash refuses to inherit
# PS1 in some circumstances that I can't figure out.
# Putting PS1 here ensures that it gets loaded every time.
PS1="[\d \t \u@\h \W]>"

Andy Hibbins

added code tags for readability --oombera

Last edited by oombera; 02-18-2004 at 11:20 AM..
 
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 Dummies Questions & Answers

Unix shell, Dos batch

Is the unix shell script equivalent to dos batch command? Thanks (2 Replies)
Discussion started by: zhshqzyc
2 Replies

3. Shell Programming and Scripting

Batch job in unix server to move the pdf file from unix to windows.

Hi Experts, I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers. Could some body provide the inputs for this. and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Discussion started by: ger199901
1 Replies

4. Shell Programming and Scripting

Executing Windows batch file from UNIX

Hi everyone, let me get straight to the points. My manager wants to execute a remote batch file (on a Windows server) from a UNIX Machine, does anyone know if this is possible and what packages would be needed? Thanks p.s. Sorry i cant give OS specifics, we use most UNIX's; AIX, Solaris,... (5 Replies)
Discussion started by: flip387
5 Replies

5. Windows & DOS: Issues & Discussions

Windows services for unix - How do I run in batch

I just installed Windows Services for Unix. I want to create a ksh program and schedule it using the Windows scheduler. How would I go about doing it? What would the command line look like? Do I always have to be in a ksh shell to run the batch program even if it is not scheduled? ... (3 Replies)
Discussion started by: rbdenham
3 Replies

6. UNIX for Dummies Questions & Answers

Unix Batch FTP - SAS

Hi All, Im trying to write a Unix FTP batch file within a program called SAS. Now i already have one for windows which works fine, but it doesnt work within unix. I've been told that some of the commands are different from Windows to Unix, and ive looked round and am completely stumped... ... (0 Replies)
Discussion started by: shenniko
0 Replies

7. UNIX for Dummies Questions & Answers

UNIX logon script/batch

Hi everyone, I am a newbies to Unix and hope someone can help me on: 1. Do anyone has batch file example that can be logon to a unix sever through telnet and exec a nohup command without typing in username and passward everytime ? 2. A java script exmaple for doing the same logon so it... (1 Reply)
Discussion started by: oht
1 Replies

8. UNIX for Dummies Questions & Answers

Batch id in UNIX

Hi can any one help me? How to find the "batchid" in UNIX? Regards, Ganapati. :confused: (1 Reply)
Discussion started by: ganapati
1 Replies

9. UNIX for Advanced & Expert Users

batch file equivalent for Unix

i was trying to do a simple batch file equivalent in Unix when i write a single command in a file, give executable permissions and run it (i gave the file name as a command at the prompt), it works fine. but when i have more than 1 command, say my file has a.out ls ls a.out it doesnt... (1 Reply)
Discussion started by: megastar
1 Replies

10. UNIX for Dummies Questions & Answers

Batch files and FTP under Unix

Hey all, Does anyone know if Unix has an equivalent to a batch file? And if so, does it work the same way as a batch file under windows? AND, if you can answer that one, is it possible to run such a file under HP-UX and have it execute while in an FTP command line? What I need to do is... (4 Replies)
Discussion started by: ober5861
4 Replies
Login or Register to Ask a Question