I created a script to check for tsm backup status on linux hosts. Script uses a source file to connect to each host and run a dsmc command on each host and write the output back to a output file located on the parent server where the script is running. The script works fine for the first 2 hosts including the parent and then fails with the following error.
Pseudo-terminal will not be allocated because stdin is not a terminal.
I searched for the above error in other *nix forums and tried using 'ssh -tt or -T' in the script per others suggestions. But I still get the same error.
You might find it easier to write a bash script that does what you want it to do,
scp it to each of the servers, then run that script remotely with the '-C' parameter.
Here is some sample code.
You should use the exec command to redirect all of the output to a log file.
Then you can copy the log file back and look at it after the script finishes
on all of the servers.
You should also look at your .bashrc and .bash_profile scripts on the third
server to see if there is anything weird going on. Finally are you running a
different OS on the third system than the first two. If that OS is older that
might explain why it doesn't work there.
This User Gave Thanks to gandolf989 For This Post:
The 3 is a file descriptor used to open the input file on, and read from. man bash:
Quote:
Redirecting Input
Redirection of input causes the file whose name results from the expansion of word to be opened for reading on file descriptor n, or the standard input (file descrip‐
tor 0) if n is not specified.
Hi All,
How can i run a single command on multiple servers with or without giving credentials.
I have a file(servers.txt) which has got list of servers and i want to run a command lsb_release -dr on all these servers and get output of those servers against each server.
I tried below code... (9 Replies)
Hello,
I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out.
I am specifically facing issues while running for loops.
I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Dear folks
I have two data set which there names are "final.map" and "1.geno" and look like this structures:
final.map:
gi|358485511|ref|NC_006088.3| 2044
gi|358485511|ref|NC_006088.3| 2048
gi|358485511|ref|NC_006088.3| 2187
gi|358485511|ref|NC_006088.3| 17654
... (2 Replies)
Normally i would do this-
cd abc
ls -ltr
I wish to run above command in a single line, like this-
cd abc | ls -ltr
But above command doesn't works, it simply runs the second command, ignoring the 1st one.
:confused: (4 Replies)
Hi,
I would like to ask if someone knows or accomplished this task in the terminal multiplexer in a single window with multiple splitted pane:
In the script run multiple command at the same time in diff splitted pane or simulatneously.
As an example: I would like to run iptraf, iotop, htop,... (2 Replies)
Hi all,
I am trying to create a shell script from solaris 10 server to run a command into multiple specific value in one file. The command is related to Oracle/Sun JES2005Q4 directory server.
#this is the command,
#from path /jes/ds/slapd-rldap1
./ns-inactivate.pl -h mldap1 -p 389 -D... (12 Replies)
I came across the command string on https://www.unix.com/shell-programming-scripting/141885-awk-removing-data-before-after-pattern.html which was what I was looking for to be able to remove data before a certain pattern. However, outputting the result to a file seems to work on an individual basis... (4 Replies)
I need a command, which could run mutliple commands from a file.
Let's say, I have
mv fileA1 fileB1
mv fileA2 fileB2
.....
mv fileA20 fileB20
I put these commands in a file, then I need a command to run the file as a whole so that I don't need to type 20 times...
Anyone tell me how to... (8 Replies)
Dear Unix Guru,
I have several directories as below
/home/user/
dir1
dir2
dir3
Each directory has different size. I want to print each directory size (Solaris command du -hs .)
Can you please guide me how to achieve this?
Thanks
Bala (2 Replies)
Hi,
Can u see the code below.
set xyz = `cat testt1.txt | awk '/-----/{\
print $1 }\
' | tail -1`
I need to execute it in c shell . What is wrong with the above command.
When i write everything on a single line then it is working.
Can anybody help me . (0 Replies)