Visit Our UNIX and Linux User Community


A mechanism like "batch file of windows" in Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers A mechanism like "batch file of windows" in Unix
# 1  
Old 09-10-2008
A mechanism like "batch file of windows" in Unix

Hi all,

Like in windows OS we have in unix something called "jobs"-term me if i am wrong- to run a sequence of steps which we can exceute at our own will without scheduling like corntab scheduling. can any one tell me what is the structure of this file and provide me with some info with this regards.

Thanks
# 2  
Old 09-10-2008

Are you talking about shell scripts?

In a shell script, you put the list of commands into a file, make it executable (chmod +x filepath), and then call it as you would any other command.

Shell scripts can do a lot more than store a list of commands; the shell is a full programming language.
# 3  
Old 09-11-2008
okkkk!! let me be more specific..
I think i didn't put my point across well.

Let me try to be more specific this time..

I have a file in my unix box, which has the me sql file names written in them.
1) Now the sql files obviously have sql statements written to create a table in the DB

2) Another sql file has code for granting permissions etc

Now all this files have an entry in an unix file that is named as say "abc.job"

This file is then run, which will execute all the sql files whose names are mentioned in the unix files.

So, can any one help in understanding this mechanism in Unix, which i bbelive has a resemblance to "batch file" in windows

Hey and i don't think this a confusion with shell scripting!!
# 4  
Old 09-11-2008
Quote:
Originally Posted by aixjadoo
So, can any one help in understanding this mechanism in Unix, which i bbelive has a resemblance to "batch file" in windows

Hey and i don't think this a confusion with shell scripting!!

Shell scripts are the equivalent of batch files and much, much
more.

See my page of links to shell resources for more information on shell scripting: http://cfaj.freeshell.org/shell/resources.shtml
# 5  
Old 09-22-2008
okk...

Let me ask one thing is there a mechanism like "job" in unix terminology.
Again i am not talking about about a corn file..
Please refer to my earlier example of executing a sequence of sql commands placed in file
# 6  
Old 09-22-2008
Quote:
Originally Posted by aixjadoo
Let me ask one thing is there a mechanism like "job" in unix terminology.

Unix shells have a "jobs" command, and other commands to manipulate jobs. What are you looking for?
Quote:
Again i am not talking about about a corn file..

What is a "corn file"? Do you mean a Korn shell script?

If so, why are you not talking about them? That's what they're for (among other things).
Quote:
Please refer to my earlier example of executing a sequence of sql commands placed in file

What you described earlier can be done with a shell script. That is the Unix method.

If you want further help, please be more specific.
 

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

SFTP batch not renaming file with "put"

I have a .ksh script that creates an sftp batch file and runs it through sftp. It works except for one thing. If I try to "put" to a different name, it doesn't use the specified remote name...it still "puts" the original local name. I've tried both of these, and neither work...it will always... (4 Replies)
Discussion started by: dbiggied
4 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

"Need progress mechanism for copy process"

Hello Folks, I got an issue to be solved. I need to show the user a progress bar while executing an process using shell script Example: While updating firmware lets assume this will take 2 min to upgrade i need the shell script to show the progress bar as (0%) and at the end it should... (13 Replies)
Discussion started by: phanivarma
13 Replies

7. UNIX for Dummies Questions & Answers

Using "Cygwin" in windows for unix

hi all Actually i am new in unix , and i am using "cygwin" software to practice unix, this is the software we can use in windows itself. some comands are working fine but some are not like "clear", also i want suggestion ,is it good to practice in " cygwin" or not thank u in advance ... (3 Replies)
Discussion started by: sanjeev1
3 Replies

8. Windows & DOS: Issues & Discussions

Unix "cut' and "awk" in Windows XP?

Hi, How can I execute Unix's ksh equivalent of "cut' and "awk" in Windows XP? For example, I want to execute ksh commands from Windows command prompt. Is there a place I can download "cut.exe" and "awk.exe" ? Thanks in advance (4 Replies)
Discussion started by: ihot
4 Replies

9. UNIX for Advanced & Expert Users

Commands on Digital Unix equivalent to for "top" and "sar" on other Unix flavour

Hi, We have a DEC Alpha 4100 Server with OSF1 Digital Unix 4.0. Can any one tell me, if there are any commands on this Unix which are equivalent to "top" and "sar" on HP-UX or Sun Solaris ? I am particularly interested in knowing the CPU Load, what process is running on which CPU, etc. ... (1 Reply)
Discussion started by: sameerdes
1 Replies

Featured Tech Videos