• Home
  • About

Snippet IT

IT News, Programming, Internet and Blogging

  • Programming and Scripting
  • Tips and Tricks
  • Software and Hardware
  • New and Happening
You are here: Home / Programming and Scripting / Unix Shell Script: How to Receive Input Right After Echoing A Line

Unix Shell Script: How to Receive Input Right After Echoing A Line

August 16, 2010 by Sze Hau Leave a Comment

For example, say I echo a line of text in shell script and I want to receive user input just right after the text (not in the next line). The are several ways to do it:

Method 1

echo "Enter a value: \c"
read value

Method 2

echo -n "Enter a value: "
read value

Method 3

read -p "Enter a value: " value

More from my site

  • MD5 and SHA1 Checksum Using LinuxMD5 and SHA1 Checksum Using Linux
  • Java: Format Bytes Array into Hexadecimal StringJava: Format Bytes Array into Hexadecimal String
  • Google Chromium OSGoogle Chromium OS
  • SherWeb: Hosted Exchange, Web Hosting, SharePoint Hosting, Hosted CRMSherWeb: Hosted Exchange, Web Hosting, SharePoint Hosting, Hosted CRM
  • Wordpress: Version 2.8.6 Security ReleaseWordPress: Version 2.8.6 Security Release
  • Wordpress: Transfer Your Blogs To Another Hosting With Minimum DowntimeWordPress: Transfer Your Blogs To Another Hosting With Minimum Downtime

Filed Under: Programming and Scripting

About Sze Hau

Geek. Love programming. Coffee addicted. Married with two children. Working towards financial freedom.

Leave a Reply Cancel reply

Advertisement

  • Facebook
  • Google+
  • Instagram
  • Twitter

Email News Letter

Sign up to receive updates daily and to hear what's going on with us

Software and Hardware

MD5 and SHA1 Checksum Using Windows

July 5, 2017 By Sze Hau Leave a Comment

Blog Network

  • Personal Fincance Personal Finance – Personal Money Tips, Stock Investment, Small Business and Make Money Online
  • szehau's weblog Life, Internet, Software, Gadgets, Programming and Investments

Snippet IT

This is the place where I want to share anything about information technology.

Search

Recent

  • MD5 and SHA1 Checksum Using Windows
  • MD5 and SHA1 Checksum Using Linux
  • Java: Unlimited Strength Jurisdiction Policy
  • WordPress: How To Change Admin Username
  • Linux: How To Compress And Decompress Folders And Files

Tags

Adsense advertisement advertising apache blog blogging tips C# EGPC error estimation format format Integer Gmail Google Google Adsense Google Chrome Google Search Engine Google search result how to HTTP internet marketing Java JavaScript Linux money password performance PHP programming search engine optimization secure security short URL SQL static constructor String tiny URL Tips and Tricks twitter video Windows Vista Wordpress wordpress plugin wordpress theme Youtube

Copyright © 2025 · Magazine Pro Theme on Genesis Framework · WordPress · Log in