commrads! I have a file:
# cat file
'\\.\Aktiv Co. Rutoken S 00 00\USER1@R69-20180109'
'\\.\Aktiv Co. Rutoken S 00 01\USER2@R69-20180109'
and i need execute line by line:
for LINE in `cat file`
do
/opt/cprocsp/bin/amd64/certmgr -inst -cont $LINE
done
BUT! The file has special content like: ' \. . and etc. And when i start my script with "set -x" i see this:
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont ''\''\\.\Aktiv'
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont Co.
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont Rutoken
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont S
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont 00
Error
+ for LINE in '`cat /home/user/Aktiv`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont '00\USER1@R69-20180109'\'''
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont ''\''\\.\Aktiv'
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont Co.
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont Rutoken
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont S
Error
+ for LINE in '`cat file`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont 00
Error
+ for LINE in '`cat /home/user/Aktiv`'
+ /opt/cprocsp/bin/amd64/certmgr -inst -cont '01\USER2@R69-20180109'\'''
IN THE IDEAL MUST BE:
/opt/cprocsp/bin/amd64/certmgr -inst -cont '\\.\Aktiv Co. Rutoken S 00 00\USER1@R69-20180109'
/opt/cprocsp/bin/amd64/certmgr -inst -cont '\\.\Aktiv Co. Rutoken S 00 01\USER2@R69-20180109'
I think it's all from special content (file). Any ideas?
for
doesn't work line-by-line. – Ignacio Vazquez-Abrams May 25 '18 at 13:19