jcdole
February 23, 2024, 2:55pm
1
My script is started from a .desktop file on usb stick.
#!/usr/bin/env xdg-open
[Desktop Entry]
Comment[en_US]=main preliminary script machine
Comment=main preliminary script machine
Exec=/run/media/$(logname)/INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/001_01_FIRST_REBOOT_FIRST_SCRIPTS/main_first_reboot_machine_script.sh
GenericName[en_US]=main preliminary script machine
GenericName=main preliminary script machine
Icon=system-run
MimeType=
Name[en_US]=main preliminary script machine
Name=main preliminary script machine
Path=
StartupNotify=true
Terminal=true
TerminalOptions=\sânoclose
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
this piece of code return the expected value :
echo
echo 3
echo
echo âls -al /run/media/$(logname) /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.shâ
ls -al /run/media/$(logname) /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.sh
echo
return :
ls -al /run/media/user_install /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.sh
-rwxrwxr-- 1 user_install user_devp 36337 18 févr. 22:50 /run/media/user_install/INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.sh
Next command return an unexpected error :
echo
echo 4
echo
echo .
echo âsource : /run/media/$(logname) /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.shâ
echo
source : /run/media/$(logname) /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.sh
the error is ; No such file or directory
4
.
source : /run/media/user_install /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.sh
/run/media/user_install /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/001_01_FIRST_REBOOT_FIRST_SCRIPTS/main_first_reboot_machine_script.sh: line 177: :: No such file or directory
Any comment is welcome.
You seriously expect everyone immediately know what is on line 177 of your script?
jcdole
February 23, 2024, 4:55pm
3
It is just the copy of the error.
The number line has no interest.
What is important is the command :
source : /run/media/$(logname) /INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/001_SCRIPTS/000_MY_FUNCTIONS/my_functions.sh
Is it possible that the use of â$(logname) â is not allowed in this situation?
jcdole
February 23, 2024, 5:22pm
4
In a terminal, I would like to know why
ls /run/media/user_install/INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/002_DATA/SYSTEM_CONFIG/2023_10_21/etc/zzzz1_system_common_function_full.sh
Return good value
/run/media/user_install/INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/002_DATA/SYSTEM_CONFIG/2023_10_21/etc/zzzz1_system_common_function_full.sh
and why
source : /run/media/user_install/INS_STEP2_MINI/NEW_INSTALL_LINUX_2023/2024_02_01_19h00/MY_PROJECTS/MY_INSTALL_STEP_1/2024_02_01_19h00/002_DATA/SYSTEM_CONFIG/2023_10_21/etc/zzzz1_system_common_function_full.sh
return error
bash: :: No such file or directory
PS : All script files are owned by user_install:user_devp
All script files have mode 774
Current script files is run by user_install
User user_install belongs to group users and group user_devp
What happens if you execute the ls
command right before the attempted execution, as well as putting in echo $(logname)
?
jcdole
February 23, 2024, 9:51pm
6
I will test this week-end a small program to check if the problem comes from where the program is called/run or if it is due to the running user.
I will give news on monday.
Thank you for helping.
jcdole
February 26, 2024, 3:07pm
7
I have not had the time to move forward on my problem. I give news as soon as I can.
I just figured it out, I believe. The issue is the colon after âsourceâ. The double colon is the formatting for when the error is displayed - if you had said âsource unknown.shâ, the error would have been âbash: unknown.sh: No such file or directoryâ. But because youâve put a colon there, itâs parsing that as a filename and thatâs why you see âbash: : : No such file or directoryâ. (The bolded colon is the filename in the error message)
Get rid of that colon and you should be fine.
knurpht
February 27, 2024, 7:38pm
11
Brilliant, hadnât seen that one.
I only noticed it because I was reading it over and questioned how source
was used in bash (Iâve only used . includefile.sh
in my scripts typically), but the syntax looked off to me when I came back to look at it again in the middle of the night a couple days ago.
1 Like
jcdole
February 29, 2024, 10:25pm
13
Did you sleep sometimes ?
Thank you very much indeed.
Sorry about all the fuss.
1 Like
I did get some sleep - thanks for asking! And glad to help out - and that this solved the issue for you.
system
Closed
March 31, 2024, 2:46am
15
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.