Problem with writing into a file through shell script
Hi all,
I have a shell script which I use to login to the server from the client and then from the server I run a bunch of other scripts to complete my task. I am having problems with the script below-
The interrupt script is given below-
The problem is that the script is not writing the files in /home/joydeep/results/interrupt.
Thanks,
Joydeep
Last edited by Franklin52; 05-25-2011 at 07:20 AM..
Reason: Please use code tags
You are absolutely right- there's no reason for a separate line1 variable. Also the nohup is not needed. I was trying those options just to see whether they made a difference. What I am trying to do through this script is to login to the server and logging in the interrupt values from the output of /proc/interrupts in the output files when the httperf script is running.
But the problem is that the output files are not getting created in this manner. The output files get created when the interrupt script is evoked from the command line. Any help in this issue would be much appreciated.
To execute a local script on remote machine, you'd do:
I am not sure how to pass arguments to localScript.sh this way... maybe someone else can show us.
This should work though:
This will redirect the output of echoInterrupt.sh and execute it (the output) on the remote machine.
echoInterrupt.sh should look something like this:
You have to escape all dollar signs, that you want to pass as literal dollar signs to server, with backslash, as in the '\$(seq 12)' string: you want to pass '$(seq 12)' to the server.
When you run
it should print all the commands as you want them executed. So for debugging, just do ./echoInterrupt.sh and look at the terminal output to check for syntax errors.
You should not need sudo, since /proc/interrupts is world-readable.
Hi, I am complete new to C programming and shell scripting. I just wrote a simple C code to calculate integral using trapezoid rule. I am prompting user to pass me No. of equally spaced points , N , upper and lower limit. My code looks as follows so far:
#include<stdio.h>
#include<string.h>... (2 Replies)
Hi,
facing an issue while calling sqlplus inside shell script. It for some reason goes to tmp file to write something and i get error as permission denied as i dont have access there.
ANy idea why sqlplus writes in /tmp and how to change or stop this ? (2 Replies)
#!/bin/csh
echo hello world
this is what i got in a text file called ss1.
i type "chmod 755 ss1.txt" to make it executable.
then when i type
ss1
or
ss1.txt
it says
"ss1 command not found"
what am i doing wrong? (19 Replies)
my default profile is using ksh, I tried to write a simple scripts and I had issues, below is my scripts:
$ more if_num.ksh
USAGE="usage: if_num.ksh"
print -n "Enter two numbers: "
read x y
if ((x=y))
then
print "You entered the same number twice."
when I tried to executed the... (6 Replies)
I am trying to prompt the user using tput command to read the information ( 5 last names, first names and grades) from the keyboard. Save the data in a file called student.txt. Sort the file by last name and display it on the screen
My pseudocode is as follow:
Pseudocode:
Initialize... (1 Reply)
Hello Folks,
I want to get the results from a SQL query which needs to be exported to a .txt file.
My Script is something like
#!/bin/ksh
db2 connect to DATABASE user user_name using pwd;
touch test.txt
isResult=0;
isResult= `db2 -x select 'ABC',COL_B from TABLE_A WHERE COL_B=CONDITION`... (6 Replies)
Self professed idot looking for help
LOL
Hi all, I am new to Unix and I have to write a shell script that will check to see if a file exist and then create it if it does not. The file I need to search for is titled "A1. dat" and here is my feeble attempt at creating the script:
#!/bin/bash... (2 Replies)
Hi All,
I am new user of shell scripting has come up with a problem. that I have a directory structure like :
Home
|
|--------A
| |----trunk
| |-------A_0_1/
| |
| |-------A_0_2/
|
|--------B
| ... (6 Replies)