Home > command line > Using read to simply short bash command

Using read to simply short bash command

October 12Hits:0

I am trying to simplify a small command I use for some video streams I use.

I can successfully call the streamed video with the following:

livestreamer -p mpv --crunchyroll-username="USERNAME_HERE" --crunchyroll-password="PASSWORD_HERE" LINK_HERE --player-passthrough hls 

I use my account info, and paste the video link. This opens the said stream in mpv and plays fine.

The bash script I am using to just call for the URL with read then complete is like this:

#!/bin/bash  read -p "Please enter URL of Crunchyroll Video: " url  livestreamer -p mpv --crunchyroll-username="USERNAME_HERE" --crunchyroll-password="PASSWORD_HERE" $url --player-passthrough hls 

However, this just does nothing, and outputs me back to a clean line. Is there something I am missing? I wonder if its possible that this is just exiting the whole command before it runs because it needs to be told to pass it on or something.

Related Articles

  • Using read to simply short bash commandOctober 12

    I am trying to simplify a small command I use for some video streams I use. I can successfully call the streamed video with the following: livestreamer -p mpv --crunchyroll-username="USERNAME_HERE" --crunchyroll-password="PASSWORD_HERE"

  • Convert all arguments in short-form to into their corresponding (if any) long-form arguments in a bash commandAugust 4

    I am looking for a program that can convert all arguments in short-form to into their corresponding (if any) long-form arguments that are present a bash command. For example: wget -m -p -k http://stackexchange.com should get converted to: wget --mirr

  • How to map one vim command to execute bash commands based on OS?April 22

    In short, can single bash commands in the terminal contain conditionals? If so, how? I have in my vimrc (shared across systems) the following command to open my current LaTeX document in .pdf form: map ,v :!gnome-open %<.pdf <CR> <CR> My qu

  • Why is the following bash command not working properly?August 20

    I have the following bash command: $(ls -l /var/ | grep www) > cat folder_exists but it is not working properly. What I hope to achieve is a command, that checks to see if there is a www folder located inside the /var/ folder, and prints the result o

  • How to use getopt in bash command line with only long options?October 17

    There is a getopt command in bash command line. getopt can used with short options (such as getopt -o axby "[email protected]"), and can be used with both short and long options (such as getopt -o axby -l long-key -- "[email protected]"), but now I need only long o

  • Can you get rid of file extensions for bash commands in cygwin?January 29

    I've just started messing around with cygwin. I've noticed when use the tab auto-complete feature for commands it always adds a '.exe' even though one isn't needed to run the command. Is there a way to hide the '.exe' part of the bash commands? -----

  • Why is this bash command not echoing into a variable and what can I do to improve?February 15

    I've got a bash script I'm working to improve, and have put on a great fix thanks to Dennis Williamson. Unfortunately, one of the lines no longer echoes into a variable I can manipulate, rather dumps the output directly. I'll be good to go if I fix t

  • How to get a launchd plist to diretly run a complex 1 line bash command?May 18

    I have a somewhat complex bash command which includes some pipes and an if-then-else clause, not to mention calling system program (such as grep) with multiple parameters. Is there a way to create a plist that launchd will load and run this complex c

  • Is there a way suspend 12.04 using a bash command while keeping the password prompt?July 21

    I desire to suspend my Ubuntu 12.04 install with a bash script. The pm-suspend command will not prompt for a password when resumed. Is there a way to suspend my machine and have a password prompt when resumed via a bash command? --------------Solutio

  • How to open a file from bash command line in the already open Emacs instead of a new instance?August 16

    How to open a file from bash command line in the already open Emacs instead of a new instance? When I type $ emacs file.txt it opens a new Emacs instance, instead of opening the file in the existing Emacs instance. Mac OS X 10.6.8. and GNU Emacs 23.4

  • Why does the sequence matter in the execution of these bash commands?March 6

    There seems to be some inconsistency that I am not able to understand regarding the bash shell. If I execute: ls;date;time the results of the three queries are shown in sequence. However, on interchanging date and time position, an error message pops

  • Having multi lines in bash command substitutionJuly 8

    I have a very long bash command inside a command substitution like following: $( comaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaand ) I want to know if there is a way to break this command into shorter lines for the sake of readability like following: $(

  • I accidentally typed password into bash command lineApril 2

    I accidentally typed my password into bash command line, mistaking the Last login: ... line for Wrong password (I was in a hurry). What do I do to cover my trace? What I did was editing .bash_history and deleting the offending line (had to relogin on

  • How to customize Bash command completion?August 5

    In bash, it's easy enough to set up customized completion of command arguments using the complete built-in. For example, if, for a hypothetical command with a synopsis of foo --a | --b | --c, you could do complete -W '--a --b --c' foo You can also cu

  • Drawing an histogram from a bash command outputJanuary 6

    I have the following output: 2015/1/7 8 2015/1/8 49 2015/1/9 40 2015/1/10 337 2015/1/11 11 2015/1/12 3 2015/1/13 9 2015/1/14 102 2015/1/15 62 2015/1/16 10 2015/1/17 30 2015/1/18 30 2015/1/19 1 2015/1/20 3 2015/1/21 23 2015/1/22 12 2015/1/24 6 2015/1/

  • bash command in python not workingFebruary 4

    I would like to run a bash command from python. My code: process = subprocess.Popen(('ifconfig -s'), stdout=subprocess.PIPE, shell=True) output = process.communicate()[0] lcd.message(output) sleep(2) lcd.clear() This executes "ifconfig -s" and t

  • Does "bash: command: command not found" return false?January 13

    I am writing a script to automate the configuration of software. I want to begin by checking to see if the script needs to install the software first, then configure it. If I was to check $ software --version and I get bash: command: command not foun

  • Bash command for regular expression substitutionJune 15

    What bash command can be used for regex substitution on a pipe? cat foo.txt | someprogram --------------Solutions------------- You probably want sed 's/exp1/exp2/g' foo.txt > foo2.txt Read more at Sed tutorial, Another tutorial, and A small tutorial

  • How can I log users' bash commands?July 13

    I'm running a debian etch server where users will be logging into (hopefully) a chroot jail through ssh. How can I have the commands they execute logged in a way they cannot delete, nor prevent? --------------Solutions------------- install snoopy. If

  • Bash command to compress folder(s) with a passwordSeptember 10

    How can I compress two folders into archive file (zip, gzip or something like that) with a password on the files? For example I have folder structure: rootDir dir1 dir2 dir3 dir4 I need bash command to add dir2 and dir4 to same archive file compresse

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.709 s.