Difference between revisions of "Sshs"

From wikieduonline
Jump to navigation Jump to search
 
(3 intermediate revisions by 2 users not shown)
Line 9: Line 9:
 
   
 
   
 
  sshs() {
 
  sshs() {
         ssh ${*:1} "cat > /tmp/.bashrc_temp" < ~/.bashrc_remote
+
         ssh ${*:1} "cat > /tmp/.bashrc_temp" < [[~/.bashrc_remote]]
         ssh -t ${*:1} "bash --rcfile /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp"
+
         ssh [[-t]] ${*:1} "[[bash --rcfile]] /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp"
 
  }
 
  }
  
Line 20: Line 20:
 
  [[.bashrc]]
 
  [[.bashrc]]
  
 +
== See also ==
 +
* {{sshs}}
 
* {{Bash}}
 
* {{Bash}}
 
* {{ssh}}
 
* {{ssh}}
 +
 +
[[Category:IT]]

Latest revision as of 16:19, 18 February 2024

sshs function
# Wrapper for ssh to automatically source bash config file on remote machine.
# Sources ~/.bashrc_remote
#
# author Jonah Dahlquist
# license CC0 

sshs() {
        ssh ${*:1} "cat > /tmp/.bashrc_temp" < ~/.bashrc_remote
        ssh -t ${*:1} "bash --rcfile /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp"
}
Source: https://gist.github.com/jonahbron/5549848


Related[edit]

.bashrc

See also[edit]

Advertising: