Passing a value to standard input in Bash is as simple as:
your-command <<< "$your_variable"
Always make sure you put quotes around variable expressions!
Be cautious, that this will probably work only in
bash
and will not work insh
.
More Related Contents:
- How can pass the value of a variable to the standard input of a command?
- How does the SQL injection from the “Bobby Tables” XKCD comic work?
- Are HTTP cookies port specific?
- Salt Generation and open source software
- Is “double hashing” a password less secure than just hashing it once?
- How should I ethically approach user password storage for later plaintext retrieval?
- Authentication versus Authorization
- Where to store JWT in browser? How to protect against CSRF?
- How can bcrypt have built-in salts?
- Remove Server Response Header IIS7
- Is it safe to enable CORS to * for a public and readonly webservice?
- Has reCaptcha been cracked / hacked / OCR’d / defeated / broken? [closed]
- Send string to stdin
- Why are porn sites appearing in my Google Analytics data?
- Convert .pfx to .cer
- Preventing Brute Force Logins on Websites
- Does HTML5 allow you to interact with local client files from within a browser
- Docker and securing passwords
- Is there any possible ways to bypass cloudflare security checks?
- Should I hash the password before sending it to the server side?
- Disable cross domain web security in Firefox
- CSRF protection: do we have to generate a token for every form?
- Is the behavior behind the Shellshock vulnerability in Bash documented or at all intentional?
- Using Symfony2’s AccessDeniedHandlerInterface
- How to redirect all HTTP requests to HTTPS using .htaccess rules?
- Why not use HTTPS for everything?
- Where is the PEM file format specified?
- Difference between CSRF and X-CSRF-Token
- MD5 security is fine? [closed]
- How to protect against direct access to images? [closed]