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 script.
My script look like:
You'll also get unexpected end of file if you've an if without fi or while without done, etc... as well as missing quotes. The latter usually prints two errors though in bash:
We'll need actual code and actual output to assist further.
This type of redirection instructs the shell to read input from the current source until a line containing only word (with no trailing blanks) is seen. All of the lines read up to that point are then used as the standard input for a command.
...
If the redirection operator is ‘<<-’, then all leading tab characters are stripped from input lines and the line containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion.
edit: i see you're calling ksh. <<- applies to ksh88/93 as well if you decide to indent with tabs.
I need run a command such as ps -ef |grep xxx on a batch of servers, how to write a script to run it without password? don't need go in each server to check?
Thanks (7 Replies)
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... (3 Replies)
Hi there,
I would write a bash script to format then create a range of folder (folder name is number) to a usb stick.
for numbers in $(seq -w 001 999)
do
pause "Press any key to start"
mkfs.vfat -F32 /dev/sdc1
mount /dev/sdc1 /media/usb
mkdir /media/$numbers
umount /dev/sdc1... (8 Replies)
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)
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)
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)
Im new to unix shell scripting, I have to run batch jobs on unix. for example i have 5 jobs. first 2 can kickoff parallely. after completely finishing the 2 previous jobs the 3 job should kick off..once 3rd is over 4 th and 5th can kick off parallely. Each jobs run for 1 or 2 hours each.
How to... (2 Replies)
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)
Hi All,
I am relatively new to UNIX.
I know some basic commands.
I am learning to write shell scripts.
My first aim is to connect to a Data Base via shell script.
Any ideas on this?
Any links, docs which will tell me about scripting??
Thanks
VEN (1 Reply)