What I thought was going to be very simple has turned out to be really lame, and so I come to you for help.
Note: lines are commented out because I don't want this to actually do anything yet.
Basically, I'm trying to check to see if a drive is mounted properly. If it is, execute another script. If not, try to mount it. If that fails, kill the process. If it succeeds, execute another script.
When I run this program, I get an unexpected end of file error. I'm assuming it's related to the nested ifs because of similar errors I read about online.
So if you know how to get around this problem with the ifs, please let me know. Thank you.
hi I keep getting an error with this nested if statement and am getting the error unexpected end of file, can anyone help me as to why this wont execute?
#!/bin/bash
#script to check wether the -i -v statements run correctly
removeFile ()
{
mv $1 $HOME/deleted
}... (3 Replies)
Given the scenario like this, if at all if have to use IFS on the below given example, how it should be used.
IFS=/
eg:
/xyz/123/348/file1
I want to use the last slash /file1 . So can anyone, suggest me how to pick the last "/" as a IFS. (4 Replies)
Hi,
This is out of curiosity:
I wanted to extract year, month and date from a variable, and thought that combining read and IFS would help, but this doesn't work:
echo "2010 10 12" | read y m d
I could extract the parts of the date when separated by a -, and setting IFS in a subshell:
... (3 Replies)
im messing up somehwere...and can't seem to clean up the script...for it to work
objectives:
1. check for today's file, and sleep 30 secs between retries
2. only allow 5 tries before script should fail.
3. if today's file found, wait 30 seconds for it to process..
code:
count=0... (8 Replies)
Hi can someone tell me whats wrong with the following:
#!/bin/sh
file1=$1
file2=$2
if
then
if
then
echo "File 1 is" $file1
echo "File 2 is" $file2
cp $file1 $file2
echo "Copy complete!"
else
echo "ERROR: File does not exist!"
... (8 Replies)
Hi!
I am working in korn shell. I want to reset the dimiliter for the set command to "|" but instead of a command prompt return I am getting something as below
After issuing the command I am getting this....as if the shell is expecting something else. Can anybody suggest what's the problem.
... (2 Replies)