-1

This may be a very simple question, but after switching from windows to linux (and being forced to use the shell way... way more often than I was forced with windows), there is still much new stuff to learn for me.

I am using fedora 25 on my laptop as my "surf and work" system. So I wanted to install Spotify, to be able to listen to music.

To install the software, I have to execute 4 commands:

1. Add the Spotify repository signing key to be able to verify downloaded packages

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886

2. Add the Spotify repository

echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list

3. Update list of available packages

sudo apt-get update

4. Install Spotify

sudo apt-get install spotify-client

My Question: Can I write these commands into a textdocument and execute them as a script?

I tried it with chmod, but I just don´t get it working right. I used this link as help (yes, I am from germany ^^)

HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
lukix
  • 1
  • 2
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Apr 07 '17 at 08:49

1 Answers1

0

Create a file whose first line is:

#!/bin/sh

Then put the commands after that.

Add execute permission to the file:

chmod +x filename

Then run the script as:

./filename
Barmar
  • 741,623
  • 53
  • 500
  • 612