I'm a little confused as to what this means. Can you post your code (wrapped in CODE tags) then show us the input you have and the expected output & errors you are getting (all wrapped in CODE tags too)
The more you can explain your issue, the more likely we are to be able to help.
There is nothing in your script that assigns a value to the variable DATA_SAS. The command:
does absolutely nothing if DATA_SAS is a variable defined in your environment when your script starts (exported variables remain exported). If DATA_SAS is not an environment variable that is exported to your script, that command sets DATA_SAS to an empty string and exports it.
If we assume that the above command is a no-op and that $DATA_SAS expands to a string that is a pathname of a file, then at least one of the following commands in your script:
has to fail. You can't change directory to a regular file; only to a directory. And you can't redirect output to a directory; only to a non-directory file.
If $DATA_SAS expands to an empty string, the redirection should fail with a syntax error.
If $DATA_SAS expands to a pathname of a directory, the redirection should fail.
If $DATA_SAS expands to a pathname of an existing regular file to which you have write permission or a non-existent file in a directory in which you have write permission, you should have gotten the output you wanted, but the attempt to change directory would have failed. Otherwise the redirection would have failed.
If we assume that $DATA_SAS does expand to the pathname of a directory, maybe you could get what you want if you change the line in your script:
to:
Last edited by zaxxon; 09-07-2016 at 08:48 AM..
Reason: changed /ICDOE to /ICODE
This User Gave Thanks to Don Cragun For This Post:
After formatting and indenting your script, there also seems to be missing 2 times fi to close the opening if.
Having a glance at your script I wonder if you ever tested any parts of it when writing it or did you just type if down all the way?
This script is executed whenever a new vehicle is added to the cycle-motor park
of campus. The script asks for the following information about the car and adds a new
line to the vehicle file.txt: name (name of an animal, unique identifier), color, mark,
model, type (e.g., electrical, manual),... (2 Replies)
Hello, im a new user on this site and learning scripting very slowly at a understanding pace. However i am up with a challenge and require help completing this.
The script has to include arguments, variables, decisions and loops. So the script is about calculating the broadcast address for any... (5 Replies)
I run a small instrument lab. We track our user's time on the instruments with a very manual process of 'last wtmp.1' then cut/paste data into spreadsheets. My boss makes the initial spreadsheets then I convert and format them for uploading into our billing software (COReS). Cores is looking for a... (8 Replies)
Hello, it is my first post :)
I need to implement some monitoring tools in a script, ping telnet traceroute
I found this one to ping, it works,
#!/bin/sh
for i in `cat /tmp/PingStatus.txt`
do
ping -c 5 -w 5 -n $i | grep -q "bytes from" && echo "$i is OK" || opcmsg object=PING a=OS... (5 Replies)
Hi All,
Does anyone have any shell script out there that looks into Oracle trace files generated in the bdump, cdump & udump directories & reports on the contents (errors) within these files.
Your help is highly appreciated.
Regards,
- divroro12 - (5 Replies)
hello experts
cany any one help me i want to make one script which can rlogin to another machine .
but it should not ask me username/password from me of another machine it should take the username and password from the script only.
please help me out.
regards,
shary (2 Replies)
Here is what I have:
#!/bin/bash
# Setup year date and month
YR=`date +%Y '{print $6}'`
MON=`date +%b '{print $2}'`
DAY=`date +%d '{print $3}'`
file=$YR$MOY$DOM
# clear
# Dump database using USER/PASS to ..sql
mysqldump --user=me -ppass database > database-db.$file.sql
The YR, MON and... (2 Replies)
Please debug this shell script for me.. Basically the idea is to run the script, based on the command to move some trace files to a separate directory and I am getting the error. Only the COMMAND that has rm {} works and I basically want to use it for the fourth one. Please try for the 2nd, 3rd and... (4 Replies)