Standard input as a plain-text
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input
linux bash shell-script
add a comment |Â
up vote
0
down vote
favorite
how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input
linux bash shell-script
Apart from using<
, are you concerned about plain text in any particular way? Your question mentions plain text three times.
â Kusalananda
May 8 at 16:31
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input
linux bash shell-script
how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input
linux bash shell-script
asked May 8 at 15:54
PRAKASH
272
272
Apart from using<
, are you concerned about plain text in any particular way? Your question mentions plain text three times.
â Kusalananda
May 8 at 16:31
add a comment |Â
Apart from using<
, are you concerned about plain text in any particular way? Your question mentions plain text three times.
â Kusalananda
May 8 at 16:31
Apart from using
<
, are you concerned about plain text in any particular way? Your question mentions plain text three times.â Kusalananda
May 8 at 16:31
Apart from using
<
, are you concerned about plain text in any particular way? Your question mentions plain text three times.â Kusalananda
May 8 at 16:31
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
Exactly as you describe, with the indirection (<
) operator:
/path/to/executable < /path/to/inputfile
add a comment |Â
up vote
1
down vote
To redirect from stdin, you don't use <
you use |
. For example (apologies for the useless use of cat)
cat /some/file | my_program
If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<<
redirection
my_program <<< "$my_variable"
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Exactly as you describe, with the indirection (<
) operator:
/path/to/executable < /path/to/inputfile
add a comment |Â
up vote
1
down vote
Exactly as you describe, with the indirection (<
) operator:
/path/to/executable < /path/to/inputfile
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Exactly as you describe, with the indirection (<
) operator:
/path/to/executable < /path/to/inputfile
Exactly as you describe, with the indirection (<
) operator:
/path/to/executable < /path/to/inputfile
answered May 8 at 16:01
DopeGhoti
40k54779
40k54779
add a comment |Â
add a comment |Â
up vote
1
down vote
To redirect from stdin, you don't use <
you use |
. For example (apologies for the useless use of cat)
cat /some/file | my_program
If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<<
redirection
my_program <<< "$my_variable"
add a comment |Â
up vote
1
down vote
To redirect from stdin, you don't use <
you use |
. For example (apologies for the useless use of cat)
cat /some/file | my_program
If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<<
redirection
my_program <<< "$my_variable"
add a comment |Â
up vote
1
down vote
up vote
1
down vote
To redirect from stdin, you don't use <
you use |
. For example (apologies for the useless use of cat)
cat /some/file | my_program
If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<<
redirection
my_program <<< "$my_variable"
To redirect from stdin, you don't use <
you use |
. For example (apologies for the useless use of cat)
cat /some/file | my_program
If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<<
redirection
my_program <<< "$my_variable"
answered May 8 at 16:53
glenn jackman
45.8k265100
45.8k265100
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442584%2fstandard-input-as-a-plain-text%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Apart from using
<
, are you concerned about plain text in any particular way? Your question mentions plain text three times.â Kusalananda
May 8 at 16:31