hi .. greetings ...i need help in bash programming. i am on linux mint.
i have two .sh files.(netcheck.sh and dlinkreboot.sh).. please note . both bash files are working perfectly well independently... but cant work together. . in short i want one bash file to call the other bash file automatically and then the control should come back to the first bash file.
the first file (netcheck.sh) detects if internet is active or gone offline. (it checks every few seconds. if internet is dead then it should call upon the second bash file.
the second file (dlinkreboot.sh) reboots the router. (rebooting the router brings the internet back online)
either you show me how to do this or
show me how both contents can be added in one single file. i tried copy pasting but it doesnt work.
both bash files have different first line (i guess its called the header)
the first one netcheck.sh has this ... #!/bin/bash
the second one dlinkreboot.sh has this ....#!/usr/bin/expect -f
these two headers dont not seem to like each other.
i dont know much about bash programming but using my rusted c++ skills that i studied 16 years back.
********************************************************************************************
This is the content of the first bash file. .. netcheck.sh to check whether net is active or not .
As part of a bash the below line strips off a numerical prefix from directory 1 to search for in directory 2.
for file in /home/cmccabe/Desktop/comparison/missing/*.txt
do
file1=${file##*/} # Strip off directory
getprefix=${file1%%_*.txt}
... (5 Replies)
In the bash below I am asking the user for a panel and reading that into bed. Then asking the user for a file and reading that into file1.Is the grep in bold the correct way to apply the selected panel to the file? I am getting a syntax error. Thank you :)
... (4 Replies)
I am writing a bash function and am having trouble calling a VBA from within it. The line in bold is the path to the VBA. Thank you :).
ngs() {
call {C:\Users\cmccabe\Desktop\Sanger\NGS_Sanger.xlsx}
cd 'C:' C:/Users/cmccabe/Desktop/Python27/
for file in... (16 Replies)
I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients).
I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
I have a file that looks like this:
cat includes
CORP-CRASHTEST-BU
e:\crashplan\
CORP-TEST
/usr/openv/java
/usr/openv/logs
/usr/openv/man
CORP-LABS_TEST
/usr/openv/java
/usr/openv/logs
/usr/openv/man
What I want to do is make three new files with just those selections. So the three... (4 Replies)
Hi all ,
I have a file with below data ,
bash#cat file.txt
user1 amount1 status1
user2 amount2 status2
user3 amount3 status3
user4 amount4 status4
.
.
.
Now i have a command to be executed with above values like below ,
./errorcheck -u user1 -a amount1 -s status1
... (3 Replies)
Hello,
This is my first post on the forums. So I want to start by thanking anyone who is kind enough to read this post and offer advise. I hope to be an active contributor now that I've found these forums.
I have an issue that I figure would be a good first post..
I have 2 text files... (5 Replies)
Hi
I m new to perl. I m trying to write a perl script that calls a bash script; does anyone have a script already that they can provide or help me out? Thanks a lot. (2 Replies)
Hi all
I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far:
File A
line 1
line 2
line 3
line 4
... (6 Replies)
Hello.
Looking for a method of modularizing my bash script, I am stuck with such a problem. For example, I have:
MODULE_NAME="test"
FUNCTION_NAME="run"
How do I can a function with name test_run? (4 Replies)