Comments (1)
Here is code to use. Question... where to put it without cluttering up the whole default file.
#!/usr/bin/env bash
function noSpace {
echo "checking $1 for space"
}
function getMachineName {
read -p "Set machine name: " NAME
echo "You entered: $NAME"
noSpace $NAME
read -p "Is this correct (y|n|q): " -srn1 INPUT
echo $INPUT
case "$INPUT" in
y|Y) # yes
echo -e "\nexecuting"
;;
n|N) # no
echo -e "Try again!"
getMachineName
;;
q|Q) # quit
echo -e "Quiting"
exit
;;
*) # all other cases
echo -e "\nERROR: "$INPUT" is not a valid entry"
getMachineName
;;
esac
}
# funcResponse=$(myFunc "print this") # call myFunc and pass in a var
# echo $funcResponse
# echo $? # this will show you the return code from the preceeding called function
# # http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-8.html
getMachineName
echo 'moving on to the next step'
from dotfiles.
Related Issues (15)
- alias for tree (to automatically ignore certain dirs)
- script to download things that cask or mas cannot (splashId for example)
- change all directory aliases to apparix entries
- Error in myBashProfiles
- BMI - tool to install/uninstall brew/brew cask/mas
- git-prompt.sh moves around on various MacOS versions
- create a .vromerc file HOT 2
- mackup - move to different directory in Dropbox
- mac defaults.sh - show progress HOT 1
- neovim brew - install latest version?
- install on 12inch mac - issues
- Add grabbing imgcat to a script HOT 1
- man to pdf - figure out how to create a tmp file that has a name associated with manpage
- where should scripts/utilities live
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotfiles.