Bash Script

Introduce yourself to us and other members here, or share your own product reviews, suggestions, and tips and tricks of using QNAP products.
Locked
nintendo1889
Starting out
Posts: 18
Joined: Wed Apr 28, 2021 5:00 am

Bash Script

Post by nintendo1889 »

I am trying to create a single command line does two actions, one after the other. It isn't working in qnap bash. This is just an example, I know that this should be in a .sh script, but there are times when I have to run two commands sequentially, or I want to test a small part of a bash script but test it from the command line.

Code: Select all

sleep 21000 ; killall rsync
I did find that this way works (putting a backslash at the end of the line and putting line 2 at the > prompt):

line 1:

Code: Select all

# sleep 21000 ; \
line 2:

Code: Select all

> echo command completed
line 3:

Code: Select all

> killall rsync
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: Bash Script

Post by OneCD »

Unclear: why are you asking this on a NAS forum? This is basic BASH, and has no relevance to QNAP. :'

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
nintendo1889
Starting out
Posts: 18
Joined: Wed Apr 28, 2021 5:00 am

Re: Bash Script

Post by nintendo1889 »

OneCD wrote: Sun May 09, 2021 2:30 am Unclear: why are you asking this on a NAS forum? This is basic BASH, and has no relevance to QNAP. :'
because basic linux functions, such as this, don't work.

https://www.howtogeek.com/269509/how-to ... ss%20Enter.
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: Bash Script

Post by OneCD »

Works fine here. Please ask about this on a Linux forum instead.

* topic locked *

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
Locked

Return to “Users' Corner”