comparison src/learn_bash.html.luan @ 53:3082eaf8457d

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 10 Jan 2024 12:59:16 -0700
parents 0bb5fa9b94cc
children
comparison
equal deleted inserted replaced
52:8e5ad4f564f5 53:3082eaf8457d
542 date* ksh* ps* tcsh* 542 date* ksh* ps* tcsh*
543 /bin $ cd ~/learn 543 /bin $ cd ~/learn
544 ~/learn $ 544 ~/learn $
545 </code> 545 </code>
546 546
547 <p><code>PATH</code> is an environment variable containing a list of directories separated by <code>:</code> that are searched for commands by Bash. The <code>which</code> command shows the full path to a command. <code>ls -F</code> appends a <code>*</code> to executable commands.</p> 547 <p><code>PATH</code> is an environment variable containing a list of directories separated by <code>:</code> that are searched for commands by Bash. The <code>which</code> command shows the full path to a command. <code>ls -F</code> appends a <code>*</code> to executable files.</p>
548 548
549 <code block> 549 <code block>
550 ~/learn $ subl file1 550 ~/learn $ subl file1
551 -bash: subl: command not found 551 -bash: subl: command not found
552 ~/learn $ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" file1 552 ~/learn $ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" file1
1020 open -a 'Sublime Text' $* 1020 open -a 'Sublime Text' $*
1021 ~/learn $ e test.sh 1021 ~/learn $ e test.sh
1022 ~/learn $ 1022 ~/learn $
1023 </code> 1023 </code>
1024 1024
1025 <p>When you write useful scripts, put them in a directory and add that directory to your PATH. I use <code>~/Dropbox/bin</code> and I have a script named <code>e</code> in that directory for editing file. So <code>e test.sh</code> lets me edit <code>test.sh</code> from the command line.</p> 1025 <p>When you write useful scripts, put them in a directory and add that directory to your PATH. I use <code>~/Dropbox/bin</code> and I have a script named <code>e</code> in that directory for editing files. So <code>e test.sh</code> lets me edit <code>test.sh</code> from the command line.</p>
1026 <% 1026 <%
1027 end 1027 end
1028 } 1028 }
1029 advanced = { 1029 advanced = {
1030 title = [[Advanced Scripting]] 1030 title = [[Advanced Scripting]]