← prev | next →
Jamerive 2022-08-13 04:39:22
Kueppo 2022-08-13 04:38:22
I use BSD and the default shell there is sh and I don’t want to have to install bash just to make my scripts run.
Ummm… But I still wonder why actual unix system still uses sh
Kueppo 2022-08-13 04:40:08
really, idk 🤔
Kueppo 2022-08-13 04:41:24
but for portability issues I think it’s better to write scripts in sh.
Jamerive 2022-08-13 04:42:01
Yep. But there are some good shells out there
Kueppo 2022-08-13 04:43:06
Yeah, thinking of trying tcsh, very similar to c and I like it.
smol_mazunki 2022-08-13 04:43:48
Jamerive 2022-08-13 04:37:14
Why does still use sh in these days?
because it’s compatible everywhere (mostly)
Jamerive 2022-08-13 04:44:02
Kueppo 2022-08-13 04:43:06
Yeah, thinking of trying tcsh, very similar to c and I like it.
Tcsh?
Jamerive 2022-08-13 04:44:23
I was thinking on modern ones
Kueppo 2022-08-13 04:44:35
advanced version of csh with more features.
Kueppo 2022-08-13 04:44:48
the called it the C shell.
Kueppo 2022-08-13 04:45:18
Jamerive 2022-08-13 04:44:02
Tcsh?
Not really fan of the modern ones tbh
smol_mazunki 2022-08-13 04:45:24
when creating software you want others to use there are some good rules:
1) everything going out should be perfect, you don’t want to be problematic. always follow standards so that people can’t come crying to you
2) never expect users to be smart. make it idiot proof so that any input is validated… with tolerance and elasticity
Kueppo 2022-08-13 04:45:48
Jamerive 2022-08-13 04:44:23
I was thinking on modern ones
using a shell written in JS is madness for me 🙂
smol_mazunki 2022-08-13 04:46:14
if you make all your code posix compliant, you can expect it to work anywhere. you won’t have compatibility issues
Jamerive 2022-08-13 04:48:17
Kueppo 2022-08-13 04:44:35
advanced version of csh with more features.
Is better than bash?
Jamerive 2022-08-13 04:48:38
smol_mazunki 2022-08-13 04:46:14
if you make all your code posix compliant, you can expect it to work anywhere. you won’t have compatibility issues
Anything unix, right?
smol_mazunki 2022-08-13 04:48:39
some more rules:
1) don’t rely on side-effects or “bugs”. those might change over time.
2) if using some libraries or dependencies, follow what the docs say. not what you “think it does”
3) document absolutely everything. in 3 weeks you won’t remember anything. users will NOT understand what you think was obvious, either
smol_mazunki 2022-08-13 04:48:45
Jamerive 2022-08-13 04:48:38
Anything unix, right?
anything everwhere
Kueppo 2022-08-13 04:49:46
Jamerive 2022-08-13 04:48:17
Is better than bash?
haven’t tested it yet, I just looked at the syntax and just the fact that its a C shell makes it more attractive, I just wanna use it for scripts not for interactive use nah.
marcotrosi 2022-08-13 13:38:40
so guys, I deleted today approx 300 offtopic messages.
ya what shall I say – please don’t let me do that again. thanks
[important! don’t respond to this message. let it be]
armanhrshaikh 2022-08-13 13:55:38
Take output result on terminal?
Eg.
cat file.txt
file.txt has echo ” hi there ”
I just want that echo “hi there ” on terminal
$ echo “hi there ”
armanhrshaikh 2022-08-13 13:56:14
Without clipboard
smol_mazunki 2022-08-13 13:58:08
armanhrshaikh 2022-08-13 13:55:38
Take output result on terminal?
Eg.
cat file.txt
file.txt has echo ” hi there ”
I just want that echo “hi there ” on terminal
$ echo “hi there “
grep “hi there” file.txt ?
armanhrshaikh 2022-08-13 13:58:37
@smol_mazunki @marcotrosi @moogiwaraa @ceda_ei
Any possibility?
smol_mazunki 2022-08-13 13:58:46
or do you mean echo “hi there” > file.txt ?
armanhrshaikh 2022-08-13 13:59:08
smol_mazunki 2022-08-13 13:58:08
grep “hi there” file.txt ?
Grepping? Will it not serve on output screen
smol_mazunki 2022-08-13 13:59:20
i didn’t understand your message
marcotrosi 2022-08-13 13:59:29
neither do I
marcotrosi 2022-08-13 13:59:39
I can’t understand what is in the file exactly
armanhrshaikh 2022-08-13 14:00:00
smol_mazunki 2022-08-13 13:58:46
or do you mean echo “hi there” > file.txt ?
echo “hi ” will give me hi
But I want that hi
$ here
smol_mazunki 2022-08-13 14:00:22
you want to auto-fill your prompt?
armanhrshaikh 2022-08-13 14:00:33
$ echo “hi”
Output should be
$ hi
armanhrshaikh 2022-08-13 14:00:47
smol_mazunki 2022-08-13 14:00:22
you want to auto-fill your prompt?
Yeah but output only
smol_mazunki 2022-08-13 14:01:14
there is stuff like vi mode and alike which is shell-specific to do that
smol_mazunki 2022-08-13 14:01:22
maybe there’s some printf shenanigans to achieve it too
← prev | next →