When you use bash to move sample.sh below, an error is generated with a special variable that substitutes the variable.
Probably because it is treated as a string, I don't think I can pull the arguments. Is there any way to do this?
[root@test]#cat sample.sh
#!/bin/bash
echo$2
echo${2}
N = 2
echo${$N}
[root@test] #sh sample.sh abc
B
B
sample.sh: line 8: ${$N}: incorrect substitution
#!/bin/bash
echo$2
echo${2}
N = 2
echo${!N}
so that
% ./sample.sh foo bar
bar
bar
bar
can be achieved.
606 Uncaught (inpromise) Error on Electron: An object could not be cloned
566 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
884 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
596 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.