While Loop over a File returning command not found
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm Trying to create a simple shell script to loop through a file line by line and execute a command with each line as a variable.
Here is my Text File:
FakeAccount
FakeUser
Here Is My Shell Script:
#!/bin/bash
while IFS= read -r line; do
"echo -e 'testpasswordntestpassword' | passwd $line"
done < "User.txt"
The Output i get back seems to be what i want, the output says:
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeAccount: command not found"
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeUser: command not found"
But if i copy this exact string: echo -e 'testpasswdntestpasswd' | passwd FakeUser
the command works just fine so why is the shell script not executing the command and its saying command not found?
bash shell-script
New contributor
add a comment |Â
up vote
0
down vote
favorite
I'm Trying to create a simple shell script to loop through a file line by line and execute a command with each line as a variable.
Here is my Text File:
FakeAccount
FakeUser
Here Is My Shell Script:
#!/bin/bash
while IFS= read -r line; do
"echo -e 'testpasswordntestpassword' | passwd $line"
done < "User.txt"
The Output i get back seems to be what i want, the output says:
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeAccount: command not found"
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeUser: command not found"
But if i copy this exact string: echo -e 'testpasswdntestpasswd' | passwd FakeUser
the command works just fine so why is the shell script not executing the command and its saying command not found?
bash shell-script
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm Trying to create a simple shell script to loop through a file line by line and execute a command with each line as a variable.
Here is my Text File:
FakeAccount
FakeUser
Here Is My Shell Script:
#!/bin/bash
while IFS= read -r line; do
"echo -e 'testpasswordntestpassword' | passwd $line"
done < "User.txt"
The Output i get back seems to be what i want, the output says:
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeAccount: command not found"
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeUser: command not found"
But if i copy this exact string: echo -e 'testpasswdntestpasswd' | passwd FakeUser
the command works just fine so why is the shell script not executing the command and its saying command not found?
bash shell-script
New contributor
I'm Trying to create a simple shell script to loop through a file line by line and execute a command with each line as a variable.
Here is my Text File:
FakeAccount
FakeUser
Here Is My Shell Script:
#!/bin/bash
while IFS= read -r line; do
"echo -e 'testpasswordntestpassword' | passwd $line"
done < "User.txt"
The Output i get back seems to be what i want, the output says:
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeAccount: command not found"
"line 4: echo -e 'testpasswdntestpasswd' | passwd FakeUser: command not found"
But if i copy this exact string: echo -e 'testpasswdntestpasswd' | passwd FakeUser
the command works just fine so why is the shell script not executing the command and its saying command not found?
bash shell-script
bash shell-script
New contributor
New contributor
New contributor
asked 1 min ago
lavarockman
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
lavarockman is a new contributor. Be nice, and check out our Code of Conduct.
lavarockman is a new contributor. Be nice, and check out our Code of Conduct.
lavarockman is a new contributor. Be nice, and check out our Code of Conduct.
lavarockman is a new contributor. Be nice, and check out our Code of Conduct.
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%2f477348%2fwhile-loop-over-a-file-returning-command-not-found%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