How to avoid banner o/p in script.?

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers How to avoid banner o/p in script.?
# 1  
Old 11-18-2016
How to avoid banner o/p in script.?

hi

I am writing a script where I don't want to display banner on terminal.

below is the script. what should I do to avoid this without doing any permanent changes. I just don't want to avoid printing banner in my script.

Code:
 
 for i in `cat IP`
        do
        ssh root@$i  ' 
        hostname
        mt -f /dev/nst0 status | tail -1
        echo done
        '
        done

I have tried ssh -q option but it's not working
# 2  
Old 11-18-2016
What banner do you mean - the remote host's system welcome and motd display?
If yes, consider defining the ~/.hush_login file (c.f. man login)
# 3  
Old 11-18-2016
hi

thx for help

where I have to define this
Code:
~/.hushlogin

this is temporary change rite ?
# 4  
Old 11-19-2016
You once create this empty file in the remote home directory.
Code:
ssh root@remotehost touch .hushlogin

# 5  
Old 11-19-2016
MadeInGermanys comments might be confusing, so let me expand, for clarity:

The file ~/.hushlogin works on a per-user-basis and suppresses the display of the MOTD (message of the day) for the user account which has it in his home-directory when this user logs in. The effect is in place as long as the file exists.

Note, though, that it will not suppress the display of the herald!

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to avoid the "temp files" in my script?

Hi ! :) I noticed that I create often of temporary files to keep character strings or other and I wish to avoid that if possible ? e.g : #!/bin/bash CONFIG_FILE="conf.cfg" TEMP_HOSTNAME="temp_file1.txt" for IP in `egrep -o '({1,3}\.){3}{1,3}' $CONFIG_FILE` do ssh "$IP"... (2 Replies)
Discussion started by: Arnaudh78
2 Replies

2. Shell Programming and Scripting

How to avoid locks while loading database through UNIX script.?

Hi, I have the following requirement: I have load_cdr as main scriptwhich loads all the file records into vertica database through unix script. But there are two files which try to update same table..n thats y my script is getting failed... Can any1 give me some logic how to over come this... (6 Replies)
Discussion started by: gnnsprapa
6 Replies

3. UNIX for Dummies Questions & Answers

Need help with banner.

is there a way to reduce the size of the banner? banner -w ? TIA (8 Replies)
Discussion started by: budz26
8 Replies

4. Shell Programming and Scripting

Banner causes scp to fail from script but not command line.

Hi, We have an interesting issue which is similar to the one in this thread, but that never provided a full answer. - Ohh apparently I can't post URLs till I have 5 posts, sorry. We have a simple script that copies files from one shelf to the other. Both shelves have an ssh banner defined. ... (3 Replies)
Discussion started by: RECrerar
3 Replies

5. Shell Programming and Scripting

Avoid interaction into script

Sorry for my english! I'm using Debian squeeze and for an assignement, i have create 2 virtual pdf cups printers. Both are working very well. To test the different administion command; i try to disable one of the printer and move his queue file to the second one. I'm able to do it easily. ... (4 Replies)
Discussion started by: lyapma
4 Replies

6. Shell Programming and Scripting

how do i avoid system hang due to ssh in script?

I have a script that collects data from about 200 servers using 'ssh'. The problem is that, process sometime hangs at some point stopping the execution of the script. Please give me some idea how can I force the execution to jump to the next step if there arises any problem !! Thanks for replies if... (1 Reply)
Discussion started by: mdangol
1 Replies

7. Shell Programming and Scripting

Avoid script running multiple times by filelock

Sometimes we need a single instance of a script to run at a time. Meaning, the script itself should detects whether any instances of himself are still running and act accordingly. When multiple instances of one script running, it’s easy to cause problems. I’ve ever seen that about 350 instances... (4 Replies)
Discussion started by: edenCC
4 Replies

8. Shell Programming and Scripting

using SSH with my script and avoid logging in manually

Hi Guys. I have 3 variables $HOST $Username $Password I want to connect to a remote server using SFTP. usr/bin/sftp -o Cipher=blowfish $HostWhere do I put in the options for the username and pwd??? I have tried different ways and nothing works. It keeps coming back and promting me. ... (5 Replies)
Discussion started by: ramangill
5 Replies

9. Shell Programming and Scripting

Avoid file creation in a script...achive same result

Guys following lines help me in getting numbers from PID column ,to be thrown into first column of a CSV file. COLUMNS=2047 /usr/bin/ps -eo pid,ppid,uid,user,args | grep -v "PID" > /tmp/masterPID.txt cat /tmp/masterPID.txt|while read line do PID=`echo $line|awk '{print $1}'` echo "$PID"... (4 Replies)
Discussion started by: ak835
4 Replies

10. Shell Programming and Scripting

avoid displaying errors while executing a script

Hi all, I am running a script on bash shell, although it gives me the desired output, it displays some errors at the prompt like this directory doesnt exists unary operator etc etc Is there someway to avoid these errors ?? Its very annoying to have these errors while the script is... (4 Replies)
Discussion started by: vikas027
4 Replies
Login or Register to Ask a Question