0
#!/usr/bin/bash

PS3="> "
games_path="$HOME/.local/share/Steam/steamapps/common"
cd $games_path

echo "Choose title"
select game_title in *; do
  appid_file=$(find "$game_title" -name "steam_appid.txt")
  read appid < "$appid_file"
  printf "Running appid %d (%s)\n" "$appid" "$game_title"
  steam steam://rungameid/$appid &>/dev/null & disown
  break
done

This script is supposed to run Steam games from command line, But for some titles the output is broken:

Choose title
1) Left 4 Dead 2
2) ProjectZomboid
3) Team Fortress 2
> 3
Running appid 440 (Team Fortress 2)
Choose title
1) Left 4 Dead 2
2) ProjectZomboid
3) Team Fortress 2
> 2
: invalid number1: printf: 108600
Running appid 108600 (ProjectZomboid)

I've tried changing %d into %s in the printf command, it broke the output even more:

Choose title
1) Left 4 Dead 2
2) ProjectZomboid
3) Team Fortress 2
> 3
Running appid 440 (Team Fortress 2)
Choose title
1) Left 4 Dead 2
2) ProjectZomboid
3) Team Fortress 2
> 2
 (ProjectZomboid)600

0 Answers0