'Couldn't read file' error in bash script with expect, sed and awk!
Ok, so I have a bash script with an embedded expect statement.
Inside of the expect statement, i'm trying to pull all of the non-comment lines from the /etc/oratab file one at a time.
Here's my command:
Now, this works at the terminal, but it doesn't work inside of the expect statement.
When executed within the expect script, I get the following error:
I think the issue is with the "awk -F: '{print $1}' " command.
I've tried escape characters, quotes, backticks, quotes with escape characters... any help or ideas would be greatly appreciated!
Guys, I have a variable in a script that I want to transform to into something else Im hoping you guys can help. It doesn't have to use sed/awk but I figured these would be the simplest.
DATE=20160120
I'd like to transform $DATE into "01-20-16" and move it into a new variable called... (8 Replies)
Hello Geeks once more,
Thanks for all the help you have been rendering..
I have a script that depends on the output of an expect statement but sometimes the main script misbehaves which I believe is a result of SSH communication error, how can I apply an error control to know whether the... (2 Replies)
Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this!
This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
please can you help me with this script ( very very important )
what I'm trying is to write program that accepts list of user as its argument
1- If a user or more are given as arguments, the script should reset files permissions as follows:
a. Directory ~/share to 750 (if it exists).
b. All... (10 Replies)
I'm writing a bash script that reads a file location from a user, and I'm wondering how to get the script to accept tab to auto complete the directories that are input. (8 Replies)
I have large number of data files, close to 300 files, lets say all files are same kind and have extension .dat , each file have mulitple lines in it.
There is a unique line in each file containing string 'SERVER'. Right after this line there is another line which contain a string 'DIGIT=0',... (4 Replies)
Hello ,
I have huge file with below content. I need to read the numeric values with in the paranthesis after = sign. Please help me with awk and sed script for it.
11.10.2009 04:02:47 Customer login not found: identifier=(0748502889) prefix=(TEL) serviceCode=().
11.10.2009 04:03:12... (13 Replies)
I've shell script where i used the below command to take the line which contains patterns.
sed -n "/$year 05:/,/$year 17:/p" trace.log | grep -f patterns.txt > output.log
This was working fine for long time, but now a days this script is not working with and throwing error like
sed:... (8 Replies)
Hi,
I am writing a shell program that executes a lot of Oracle SQL Files on different databases based on the enviroment setting value. I am trying to design a parameter file where i can store the environment values for all the databases in the below format
Environment File
File Name... (6 Replies)
Guys,
I'm testing a simple script that connects to a server, does a few checks and sends the results to a file.
code:
#!/bin/ksh
expect <<-EOF | sed 's/^M//' >> file
spawn ssh user@server
expect "password:" { send "password \n" }
expect "$"
send "df -k /dev/md/dsk/d10 |... (4 Replies)