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 to pass the value of a variable to the standard input of a command?
- How do I create a self-signed certificate for code signing on Windows?
- Non-random salt for password hashes
- Prevent PDF file from downloading and printing
- JWT refresh token flow
- Cross Domain Login – How to log a user in automatically when transferred from one domain to another
- Where do you store your salt strings?
- How do you protect your software from illegal distribution? [closed]
- Best Practices: Salting & peppering passwords?
- What should every programmer know about security? [closed]
- Stopping users voting multiple times on a website
- What’s the right OAuth 2.0 flow for a mobile app
- What is the most secure seed for random number generation?
- Moving old passwords to new hashing algorithm?
- Best way for a ‘forgot password’ implementation? [closed]
- IIS7, web.config to allow only static file handler in directory /uploads of website
- Should JWT be stored in localStorage or cookie? [duplicate]
- Is it worth encrypting email addresses in the database?
- How to do stateless (session-less) & cookie-less authentication?
- Is it possible to reverse a SHA-1 hash?
- WS on HTTP vs WSS on HTTPS
- Secure Google Cloud Functions http trigger with auth
- Is there a way to force apache to return 404 instead of 403?
- RSA signature size?
- What is the appropriate way to manage API secrets within a Google Apps script?
- Google Authenticator available as a public service?
- Securing an API: SSL & HTTP Basic Authentication vs Signature
- What’s wrong with XOR encryption?
- Should be used for JSF 2.2 CSRF protection?
- Setting cookie in iframe – different Domain