1

I'm trying to run the following script:

#!/bin/bash set -e python process_init.py python process_global_variables.py python process_strings.py python process_skills.py python process_music.py python process_animations.py python process_meshes.py python process_sounds.py python process_skins.py python process_map_icons.py python process_factions.py python process_items.py python process_scenes.py python process_troops.py python process_particle_sys.py python process_scene_props.py python process_tableau_materials.py python process_presentations.py python process_party_tmps.py python process_parties.py python process_quests.py python process_info_pages.py python process_scripts.py python process_mission_tmps.py python process_game_menus.py python process_simple_triggers.py python process_dialogs.py python process_global_variables_unused.py python process_postfx.py rm *.pyc echo echo ______________________________ echo echo Script processing has ended. /bin/bash 

I get this error:

Warning: Could not start program '/home/lhossangren/source/build_module.sh' with arguments '/home/lhossangren/source/build_module.sh'.

Warning: execve: No such file or directory

I am running OpenSUSE 15.1, and have both the 64 and 32 bit libraries for Python 2.7.3.

Edit: Also, when I try to execute the file by command line, I get:

invalid option line 2: set: - set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
': [Errno 2] No such file or directorypy
': [Errno 2] No such file or directoryl_variables.py etc, for each of the .py files listed in the script.

2
  • Is your script executeable (+x)? If not chmod +x /home/lhossangren/source/build_module.sh Commented Jan 6, 2020 at 14:23
  • Yes. I had already set it's permissions via the GUI, but I did chmod too just in case after it gave me trouble. Commented Jan 6, 2020 at 15:44

1 Answer 1

2

You probably used Windows line endings (\r\n) in the file, so the kernel can not find the interpreter /bin/bash^M, bash can not parse set -e^M and so on.

Any decent editor can correct line endings. Otherwise you can also use tr:

tr -d '\r' <build_module.sh >build_module_corrected.sh 
2
  • 1
    That worked. What editors will show me the line endings? I was using Kate. Commented Jan 6, 2020 at 22:22
  • Most will set Unix line endings on Unix systems, but preserve line endings on existing files, so you don't have to worry. I don't know about Kate, but VIM shows that info in the status line. Commented Jan 6, 2020 at 22:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.