Skip to main content
Post Closed as "Duplicate" by muru, CommunityBot
added 4 characters in body
Source Link

I use a variety of different alias[1]alias**[1]** as shortcuts to frequent commands, and understand the basics of programming but am an absolute beginner when it comes to shell/ksh88 syntax. I would like to use a short command for streaming youtube videos from the obsd server which I connect to using ssh. The following : yt-dlp <URL> -o - | mpv - -force-seekable=yes works well but how can I do something like alias mpvyt='yt-dlp %s -o - | mpv -' <URL> so that I don't have to type the full command ?

[1] (you may skip this irrelevant block of code, I just copy-pasted my terminal output to brag about my network and aliases)

I use a variety of different alias[1] as shortcuts to frequent commands, and understand the basics of programming but am an absolute beginner when it comes to shell/ksh88 syntax. I would like to use a short command for streaming youtube videos from the obsd server which I connect to using ssh. The following : yt-dlp <URL> -o - | mpv - -force-seekable=yes works well but how can I do something like alias mpvyt='yt-dlp %s -o - | mpv -' <URL> so that I don't have to type the full command ?

[1]

I use a variety of different alias**[1]** as shortcuts to frequent commands, and understand the basics of programming but am an absolute beginner when it comes to shell/ksh88 syntax. I would like to use a short command for streaming youtube videos from the obsd server which I connect to using ssh. The following : yt-dlp <URL> -o - | mpv - -force-seekable=yes works well but how can I do something like alias mpvyt='yt-dlp %s -o - | mpv -' <URL> so that I don't have to type the full command ?

[1] (you may skip this irrelevant block of code, I just copy-pasted my terminal output to brag about my network and aliases)

added 4 characters in body
Source Link

I use a variety of different alias[1] as shortcuts to frequent commands, and understand the basics of programming but am an absolute beginner when it comes to shell/ksh88 syntax. I would like to use a short command for streaming youtube videos from the obsd server which I connect to using ssh. The following : yt-dlp <URL> -o - | mpv - -force-seekable=yes works well but how can I do something like alias mpvyt='yt-dlp %s -o - | mpv -' <URL>how can I do something like alias mpvyt='yt-dlp %s -o - | mpv -' <URL> so that I don't have to type the full command ?

I use a variety of different alias[1] as shortcuts to frequent commands, and understand the basics of programming but am an absolute beginner when it comes to shell/ksh88 syntax. I would like to use a short command for streaming youtube videos from the obsd server which I connect to using ssh. The following : yt-dlp <URL> -o - | mpv - -force-seekable=yes works well but how can I do something like alias mpvyt='yt-dlp %s -o - | mpv -' <URL> so that I don't have to type the full command ?

I use a variety of different alias[1] as shortcuts to frequent commands, and understand the basics of programming but am an absolute beginner when it comes to shell/ksh88 syntax. I would like to use a short command for streaming youtube videos from the obsd server which I connect to using ssh. The following : yt-dlp <URL> -o - | mpv - -force-seekable=yes works well but how can I do something like alias mpvyt='yt-dlp %s -o - | mpv -' <URL> so that I don't have to type the full command ?

deleted 83 characters in body
Source Link
Last login: Tue Oct 31 06:54:34 on ttys002
sylvain@sylvainmac ~ % more /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

#192.168.1.254  box
192.168.1.1     srv

#192.168.1.11   lap
192.168.1.21    mac

192.168.1.51    droid
sylvain@sylvainmac ~ % grep alias .zprofile
alias u='brew update && brew upgrade ; sudo port selfupdate && sudo port upgrade outdated' #update command
alias z='ncmpcpp'
alias srvsh='ssh sylvain@srv'
alias srvx='ssh -X sylvain@srv' #used from xquartz, deprecated
alias srvm='sshfs sylvain@srv: ~/srv'
alias sic='sic -n sylvainsab'
alias l='ls'
alias la='ls -a'
alias ll='ls -l'
alias lla='ls -la'
#alias ll='ls -alph | grep "/" && ls -alph | grep -v "/" | grep -v "total"'
sylvain@sylvainmac ~ % srvsh
sylvain@srv'ssylvain@srv password: 
Last login: Tue Oct 31 06:56:06 2023 from 192.168.1.21
OpenBSD 7.4 (GENERIC.MP) #0: Sun Oct 22 12:13:42 MDT 2023

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

$grep alias .kshrc  
alias l='ls -F'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -Al'
alias t='tmux attach'
alias z='ncmpcpp'
alias fxr='firefox-esr -P remote &' #used with xquartz, deprecated
alias n='doas umount /mnt'
alias u='doas pkg_add -Uu && doas syspatch && doas fw_update' #update command
alias macm='doas sshfs -o idmap=user,allow_other,uid=1000,gid=1000 sylvain@mac: ~/mac'
alias rmds='find . -iname *.DS_Store -exec rm {} \;'
alias mic_on='doas sysctl kern.audio.record=1'
alias mic_off='doas sysctl kern.audio.record=0'
alias cam_on='doas sysctl kern.video.record=1'
alias cam_off='doas sysctl kern.video.record=0'
alias ytdl='yt-dlp --prefer-free-formats -f bestvideo+bestaudio --audio-quality 0 -o "%(title)s-%(id)s.%(ext)s"'  
$^D
Connection to srv closed.
sylvain@sylvainmac ~ % 

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Opération terminée]
Last login: Tue Oct 31 06:54:34 on ttys002
sylvain@sylvainmac ~ % more /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

#192.168.1.254  box
192.168.1.1     srv

#192.168.1.11   lap
192.168.1.21    mac

192.168.1.51    droid
sylvain@sylvainmac ~ % grep alias .zprofile
alias u='brew update && brew upgrade ; sudo port selfupdate && sudo port upgrade outdated' #update command
alias z='ncmpcpp'
alias srvsh='ssh sylvain@srv'
alias srvx='ssh -X sylvain@srv' #used from xquartz, deprecated
alias srvm='sshfs sylvain@srv: ~/srv'
alias sic='sic -n sylvainsab'
alias l='ls'
alias la='ls -a'
alias ll='ls -l'
alias lla='ls -la'
#alias ll='ls -alph | grep "/" && ls -alph | grep -v "/" | grep -v "total"'
sylvain@sylvainmac ~ % srvsh
sylvain@srv's password: 
Last login: Tue Oct 31 06:56:06 2023 from 192.168.1.21
OpenBSD 7.4 (GENERIC.MP) #0: Sun Oct 22 12:13:42 MDT 2023

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

$grep alias .kshrc  
alias l='ls -F'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -Al'
alias t='tmux attach'
alias z='ncmpcpp'
alias fxr='firefox-esr -P remote &' #used with xquartz, deprecated
alias n='doas umount /mnt'
alias u='doas pkg_add -Uu && doas syspatch && doas fw_update' #update command
alias macm='doas sshfs -o idmap=user,allow_other,uid=1000,gid=1000 sylvain@mac: ~/mac'
alias rmds='find . -iname *.DS_Store -exec rm {} \;'
alias mic_on='doas sysctl kern.audio.record=1'
alias mic_off='doas sysctl kern.audio.record=0'
alias cam_on='doas sysctl kern.video.record=1'
alias cam_off='doas sysctl kern.video.record=0'
alias ytdl='yt-dlp --prefer-free-formats -f bestvideo+bestaudio --audio-quality 0 -o "%(title)s-%(id)s.%(ext)s"'  
$^D
Connection to srv closed.
sylvain@sylvainmac ~ % 

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Opération terminée]
Last login: Tue Oct 31 06:54:34 on ttys002
sylvain@sylvainmac ~ % more /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

#192.168.1.254  box
192.168.1.1     srv

#192.168.1.11   lap
192.168.1.21    mac

192.168.1.51    droid
sylvain@sylvainmac ~ % grep alias .zprofile
alias u='brew update && brew upgrade ; sudo port selfupdate && sudo port upgrade outdated' #update command
alias z='ncmpcpp'
alias srvsh='ssh sylvain@srv'
alias srvx='ssh -X sylvain@srv' #used from xquartz, deprecated
alias srvm='sshfs sylvain@srv: ~/srv'
alias sic='sic -n sylvainsab'
alias l='ls'
alias la='ls -a'
alias ll='ls -l'
alias lla='ls -la'
sylvain@sylvainmac ~ % srvsh
sylvain@srv password: 
Last login: Tue Oct 31 06:56:06 2023 from 192.168.1.21
OpenBSD 7.4 (GENERIC.MP) #0: Sun Oct 22 12:13:42 MDT 2023

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

$grep alias .kshrc  
alias l='ls -F'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -Al'
alias t='tmux attach'
alias z='ncmpcpp'
alias fxr='firefox-esr -P remote &' #used with xquartz, deprecated
alias n='doas umount /mnt'
alias u='doas pkg_add -Uu && doas syspatch && doas fw_update' #update command
alias macm='doas sshfs -o idmap=user,allow_other,uid=1000,gid=1000 sylvain@mac: ~/mac'
alias rmds='find . -iname *.DS_Store -exec rm {} \;'
alias mic_on='doas sysctl kern.audio.record=1'
alias mic_off='doas sysctl kern.audio.record=0'
alias cam_on='doas sysctl kern.video.record=1'
alias cam_off='doas sysctl kern.video.record=0'
alias ytdl='yt-dlp --prefer-free-formats -f bestvideo+bestaudio --audio-quality 0 -o "%(title)s-%(id)s.%(ext)s"'  
$^D
Connection to srv closed.
sylvain@sylvainmac ~ % 

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Opération terminée]
Source Link
Loading