-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 ^^)

4

1 回答 1

0

创建一个文件,其第一行是:

#!/bin/sh

然后把命令放在后面。

给文件添加执行权限:

chmod +x filename

然后将脚本运行为:

./filename
于 2017-04-06T22:40:33.033 回答