from "man 1 passwd": --stdin This option is used to indicate that passwd should read the new password from standard input, which can be a pipe. So in your case adduser "$1" echo "... Read More
The * is expanded, what you can do is use sed instead of grep and get the name of the branch immediately: branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') And a version using git symbolic-ref, as... Read More
Yes, if you redirect the output, it won't appear on the console. Use tee. ls 2>&1 | tee /tmp/ls.txt... Read More
You can use: printf '=%.0s' {1..100} How this works: Bash expands {1..100} so the command becomes: printf '=%.0s' 1 2 3 4 ... 100 I've set printf's format to =%.0s which means that it will always p... Read More
while takes a command to execute, so you can use the simpler while ./runtest; do :; done This will stop the loop when ./runtest returns a nonzero exit code (which is usually indicative of failure).... Read More
curl -s http://google.com > temp.html works for curl version 7.19.5 on Ubuntu 9.10 (no progress bar). But if for some reason that does not work on your platform, you could always redirect stderr to... Read More
.bashrc is not sourced when you log in using SSH. You need to source it in your .bash_profile like this: if [ -f ~/.bashrc ]; then . ~/.bashrc fi... Read More
Only for modification time if test `find "text.txt" -mmin +120` then echo old enough fi You can use -cmin for change or -amin for access time. As others pointed I don’t think you can track creati... Read More
MACHINE_TYPE=`uname -m` if [ ${MACHINE_TYPE} == 'x86_64' ]; then # 64-bit stuff here else # 32-bit stuff here fi... Read More
I believe git config --global core.pager 'less -x1,5' References: Original: (No longer valid) git-scm chp7-1 Newer: git-config#git-config-corepager Customizing Git... Read More