Answers to: Bash Scripting Questionshttp://linuxexchange.org/questions/1464/bash-scripting-questions<p>Ok, I've got a basic bash scripting question, but the answer is so simple it eludes me.</p> <p>From my .bash_aliases file....</p> <p>PROBLEM 1:</p> <p><pre><code></p> <p># alias reboot-win-host='net rpc shutdown -S thehostname -U username -r -f -t 120 -c "This system will reboot in 2 minutes. Save any work now." &amp;&amp; echo Rebooting Remote Windows System' # alias reboot-win-ip='net rpc shutdown -I 111.111.111.111 -U username -r -f -t 120 -c "This system will reboot in 2 minutes. Save any work now." &amp;&amp; echo Rebooting Remote Windows System' #</p> <p></pre></code></p> <p>What variable(s) do I use for the hostname (or IP) and the username?</p> <p>I want to: $ reboot-win-host hostname-here username-here or $ reboot-win-ip ip-here username-here</p> <p>PROBLEM 2</p> <p>For these, I can't get them to work for whatever reasoning....</p> <p><pre><code> alias perm='stat -c '%A %a %n'' alias list-root-id='awk -F: '($3 == "0") {print}' /etc/passwd' alias install-date='ls /var/lib/dpkg/info/*.list -lht | tail -1 | awk '{print $6}'</p> <p>top 25 process/RAM usage alias top-proc='ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 25'</p> <p>Graphic connections to hosts alias hosts-connect='netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c \ | awk '{ printf("%s\t%s\t",$2,$1) ; for (i = 0; i &lt; $1; i++) {printf("*")}; print ""}' </pre></code></p>enFri, 20 Jan 2017 16:44:30 -0000