Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> LINUX script, sript
als7sda
post Jan 10 2006, 12:13 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 10-January 06
Member No.: 5,953



Problem summary: LINUX scripting

Problem description:
ls CA*.DAT cat > cfiles.txt


The above was place within a shell script but the
file was created with as cfiles.txt? and is
unreadable. Can you tell me how I can correct this
problem. The mail is sent if I run
$ ls CA*.DAT cat > cfiles.txt from the command prompt to create the and then run the script.

complete script below
#!/bin/bash
# Cat Files for OCAS
ls CA*.DAT >/u03/banjobs/cfile.txt
mail -s "CANA Files" halon@banederaa.com < cfile.txt
Go to the top of the page
 
+Quote Post
als7sda
post Jan 10 2006, 03:50 PM
Post #2


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 10-January 06
Member No.: 5,953



I found the bug.
The line should be
ls CA*.DAT >'/u03/banjobs/cfile.txt'

while ls CA*.DAT >/u03/banjobs/cfile.txt will work from the prompt, it will not work from within a script.
Go to the top of the page
 
+Quote Post
DS2K3
post Jan 11 2006, 02:07 PM
Post #3


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,284
Joined: 14-November 04
From: Southampton, Hampshire
Member No.: 4,165



Try adding a cd line to change to the directory that you want to be in first. Also, make sure that you are actually using bash as the shell that you're testing things on.

D


--------------------
Fixed your problem? Let us know!
richard@linuxhelp.net

www.Gathr.co.uk Online Event Management
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 03:17 AM