nicely formatted directory listing from batch ssh session
Hi,
I am really struggling to finish of a script I have been assigned.
The script's purpose is to log on to each server defined in an array, determine the Web Server version, and list the directory beneath the installation directory. In my case, this installation directory is almost always "/opt/IBMHTTPServer" (sometimes "/opt/IBMHttpServer")
Here's a snippet from the code.
(That sed command above come from a UNIX forums frequent, i forget the name! Thanks though - the two commented DirectoryListing vars are just experimentation)
So after this script has done it's thing, it invokes a perl script (html_mail) to send the report. (I didn't make this, and I know it works well). The mail comes through as planned, however the directory listing is very ugly, it looks like this:
I would like the above files/directory's to be listed like they would be after issuing `ls -1` from the shell.
Thank you for reading my post, I hope someone can help me. If you have any comments of the quality of the code above please air them, as it is my first (somewhat) useful script, and I'm eager for all the feedback I can get. (Full version of the script is Bash pastebin - collaborative debugging tool)
When I do as you suggest, no output returns for the directory structure listing.
I tried my other two experimental "DirectoryListing" variables with the variable "double quoted" in the echo statement, that gives output, but the same, ugly, output I was having before.
Greetings to you. I have a quick question for the community today ;)
I'm interested in the following format for recursive output from a command such as "ls" or "dir" when pointed to a folder:
...but there doesn't seem to be coverage for this type of output formatting in the manpages.
Maybe... (11 Replies)
Dear Gurus,
I had hundreds of equipments which i can only use SSH to login and retrieve informations. Thus, how should i do that? eg:ssh batch
@ echo off
ssh <server1>@10.168.1.1
ECHO testing1
exit
ssh <server2>@10.168.1.2
ECHO testing2
exit
Can the above method used? :) (6 Replies)
I ran a job using SSH and then used screen command followed by space bar. Then I ran the job. But after some hours, the internet connection was lost.This had happened to me before. I used to run the whole job again. Today I came across the fact that I could restart the jobs without having to do it... (2 Replies)
Hi,
I want to execute some script on the remote session and transfer the processed file on remote machine to local machine.
I tried with ssh-keygen and ssh-copy-id but seems that this has been disable on the remote machines,
Is there any possiblity that I can save the remote username and... (7 Replies)
Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands.
With the putty I can connect to the device and execute the commands without any issues.
Here is the sample script
my $ssh =... (0 Replies)
We have a Solaris 10 server that we're migrating an old Cadre Teamwork application to. We find that when users on Sun workstations use ssh -X <username>@<new server> and run Teamwork on this new server it is fine.
When cygwin users and linux users run ssh -X to get to this new platform they... (0 Replies)
I know the root login/password for a machines, and I want to automate some commands like this from each:
ssh root@remoteHost1 "tail /var/log/messages"
ssh root@remoteHost2 "tail /var/log/messages"
ssh root@remoteHost3 "tail /var/log/messages"
ssh root@remoteHost4 "tail /var/log/messages"
ssh... (2 Replies)
Team,
I am trying to do ssh batch as root. I have ssh set-up to do work w/o requiring password/uid on remotes.
The problem is I need to submit batch work to remote systems, and NOT have my terminal program.sh lock/wait for the response from remote. This is so I can submit batch work to other... (2 Replies)
Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories.
The following command also shows the files but I only want to see the directories.
ls -lrtR * (4 Replies)