0

So I have a script (the code is below) and I am getting the following error.

Error:

Syntax error near unexpected token newline (line 5)

The code around this error is

Sbalert -t "Updating" -m "Downloading and installing the update. Please don't touch your device until it reboots" -d "" & 
alert_id="$!"
apt-get install --only-upgrade <Whited00r 7.1 OTA>
reboot

This has been made for an iPod using bash so it may be different to the ones on desktop... And if there is another way to update a specific package that would be nice as well...

iTechy
  • 283
  • 1
  • 3
  • 18
  • Stack Overflow's syntax highlighting has potentially answered your question: it looks like you are missing a closing double quote after `"string2`. – Tom Fenech Sep 18 '14 at 19:22
  • That's the entire script... Just without the shebang I'll edit it to reflect the code more... – iTechy Sep 18 '14 at 19:25

1 Answers1

2

Consider this line:

apt-get install --only-upgrade <Whited00r 7.1 OTA>

The < and > characters are special to the shell. They tell it to perform input and output redirection. The shell expects a filename after each. Since you put > at the end of the line, the shell is complaining.

If the package is named Whited00r 7.1 OTA, then you need to run this command:

apt-get install --only-upgrade "Whited00r 7.1 OTA"

However, I have no idea if that is actually the name of a package you can install.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
  • that was a typo.. Updated the code to fix it. Sorry about that. – iTechy Sep 18 '14 at 19:23
  • @itechy21 This is the correct answer. The `` part of that line is incorrect. What is the name of the package you are trying to install? – Etan Reisner Sep 18 '14 at 20:00
  • I used [link](http://askubuntu.com/questions/44122/how-to-upgrade-a-single-package-using-apt-get) to get information for what to use – iTechy Sep 18 '14 at 20:14
  • Thank you very much for your help. It is the right package as it is called Whited00r 7.1 OTA and its done on iOS via cydia but using apt-get I have cut out the slowness cydia does to the old idevices... – iTechy Sep 19 '14 at 06:40