I have tried two separate shells ( sh and tcsh ) to see if there is any change to this behaviour but there is no change.
I have checked man pages of each command and shell to see if there is something that i have missed or
misunderstood. I have also tried searching online, but so far i have been unable to locate anything that provides an explanation.
The command that I am using is meant to generate a playlist of media files, run from within the directory of said files I
wish to make a playlist of.
The command is:
If for example I am in a directory /usr/local/home/user/media, in which there are the following files:
File.S01E01.mkv
File.S01E02.mkv
File.S01E03.mkv
File.S01E04.mkv
File.S01E05.mkv
when i run the above command directly from the terminal it will create the file pl.m3u and contain a list of all of the
files as presented above in the "media" directory.
However if i use that same command in ~/.shrc as:
Or as a script mpl.sh:
Or if using tcsh
with the corresponding alias in ~/.tcshrc
the output from either the alias or script is as follows:
File.S01E01.mkv
File.S01E02.mkv
File.S01E03.mkv
File.S01E04.mkv
File.S01E05.mkv
zz
when using a script i have it placed in ~/.local/share/scripts and call it from that path after of course having
After having added the alias to .shrc for example, i will typically exit the terminal, and re-open it as i have found that
I was wondering if anyone might have any ideas as to why the differing output is occurring.
[EDIT: Spelling]
I have checked man pages of each command and shell to see if there is something that i have missed or
misunderstood. I have also tried searching online, but so far i have been unable to locate anything that provides an explanation.
The command that I am using is meant to generate a playlist of media files, run from within the directory of said files I
wish to make a playlist of.
The command is:
ls > zz && sed '$d' zz > pl.m3u && rm zz
If for example I am in a directory /usr/local/home/user/media, in which there are the following files:
File.S01E01.mkv
File.S01E02.mkv
File.S01E03.mkv
File.S01E04.mkv
File.S01E05.mkv
when i run the above command directly from the terminal it will create the file pl.m3u and contain a list of all of the
files as presented above in the "media" directory.
However if i use that same command in ~/.shrc as:
Code:
alias mpl="ls > zz && sed '$d' zz > pl.m3u && rm zz"
Or as a script mpl.sh:
Code:
#! /bin/sh
ls > zz && sed '$d' zz > pl.m3u && rm zz
Or if using tcsh
Code:
#! /bin/tcsh
ls > zz && sed '$d' zz > pl.m3u && rm zz
with the corresponding alias in ~/.tcshrc
the output from either the alias or script is as follows:
File.S01E01.mkv
File.S01E02.mkv
File.S01E03.mkv
File.S01E04.mkv
File.S01E05.mkv
zz
when using a script i have it placed in ~/.local/share/scripts and call it from that path after of course having
chmod +x
.After having added the alias to .shrc for example, i will typically exit the terminal, and re-open it as i have found that
source .shrc
results in the error "/bin/sh: source: not found"I was wondering if anyone might have any ideas as to why the differing output is occurring.
[EDIT: Spelling]