Don’t Script Your Password! Add Simple Prompts to Shell Scripts

Posted by linuxaria on Mar 9, 2013 11:50 PM EDT
linux-news.org; By Matt Butcher
Mail this story
Print this story

I hate typing long shell commands, so I often create for myself short shell scripts that perform common tasks for me. I can hard-code all those options and arguments. Sometimes, though, there are a few bits that I want to change on a run or I don’t want to hard code into a shell script. Here’s an excellent example: I don’t want my password stored in a shell script. Ideally, what I want is to be prompted for my password. There is a very simple shell built-in that you can use to do this: read. Here’s how it’s used.

Full Story

  Nav
» Read more about: Story Type: Tutorial

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.