Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previaÚltima revisiónAmbos lados, revisión siguiente | ||
tutorial_de_fish [2022/06/28 22:46] – [Inicio (Dónde está .bashrc?)] peron | tutorial_de_fish [2022/07/05 20:14] – [Conditionales (If, Else, Switch)] peron | ||
---|---|---|---|
Línea 5: | Línea 5: | ||
==== Activar el intérprete de comandos Fish ==== | ==== Activar el intérprete de comandos Fish ==== | ||
- | <code bash> | + | En nuestro sistema [[BSD]] podrás [[interpretes de comandos# |
- | + | <code bash>chsh -s / | |
- | En la línea '' | + | Deberás reiniciar |
- | + | ||
- | <code bash>/ | + | |
- | + | ||
- | Guarda los cambios y reinicia | + | |
==== Ejecutar Comandos ==== | ==== Ejecutar Comandos ==== | ||
- | [[Fish shell]] ejecuta comandos como cualquier otra [[interpretes de comandos|shell]]: | + | [[fish|Fish shell]] ejecuta comandos como cualquier otra [[interpretes de comandos|shell]]: |
<code bash> | <code bash> | ||
Línea 226: | Línea 222: | ||
env | grep MiVariable | env | grep MiVariable | ||
- | MyVariable=AlgunValue</ | + | MiVariable=AlgunValor</ |
- | También puedes des-exportarlas con **--unexport** | + | También puedes des-exportarlas con **--unexport** |
¡Esto también opera a la inveersa! Si fish comienza con algo más, heredará las variables exportadas por su proceso progenitor. De modo que si tu emulador de terminar ejecuta fish, y exporta | ¡Esto también opera a la inveersa! Si fish comienza con algo más, heredará las variables exportadas por su proceso progenitor. De modo que si tu emulador de terminar ejecuta fish, y exporta | ||
- | '' | + | '' |
Las variables exportadas pueden ser locales, globales o universales; | Las variables exportadas pueden ser locales, globales o universales; | ||
Línea 334: | Línea 330: | ||
set os (uname) | set os (uname) | ||
- | echo $os | + | echo $so |
Linux | Linux | ||
</ | </ | ||
Línea 380: | Línea 376: | ||
echo ¡fish; echo es un pescado | echo ¡fish; echo es un pescado | ||
- | # or | + | # o |
echo fish | echo fish | ||
echo es un pescado! | echo es un pescado! | ||
Línea 422: | Línea 418: | ||
</ | </ | ||
- | ==== Conditionales | + | ==== Condicionales |
Línea 432: | Línea 428: | ||
else if grep bash /etc/shells | else if grep bash /etc/shells | ||
echo " | echo " | ||
+ | else if grep ksh /etc/shells | ||
+ | echo "¡Me pesqué un korn-alito!" | ||
else | else | ||
- | echo "No pesqué | + | echo "No pesqué |
end | end | ||
</ | </ | ||
Línea 440: | Línea 438: | ||
<code bash> | <code bash> | ||
- | if test " | + | if test " |
- | echo FLOUNDER | + | echo CORNALITO |
end | end | ||
- | # or | + | # o |
- | if test "$number" -gt 5 | + | if test "$numero" -gt 5 |
- | echo $number | + | echo $cantidad |
else | else | ||
- | echo $number | + | echo $cantidad |
end | end | ||
Línea 643: | Línea 641: | ||
>Si deseas organizar tus configuraciones, | >Si deseas organizar tus configuraciones, | ||
- | ==== Autoloading Functions | + | ==== Funciones de Autocarga |
- | When fish encounters a command, it attempts to autoload a function for that command, by looking for a file with the name of that command in '' | + | Cuando |
- | For example, if you wanted to have a function | + | Por ejemplo, si deseas tener una función llamada '' |
<code bash> | <code bash> | ||
Línea 657: | Línea 655: | ||
</ | </ | ||
- | This is the preferred way to define your prompt | + | Esta es también la manera preferida de definir tu //prompt// en Fish: |
<code bash> | <code bash> | ||
Línea 665: | Línea 663: | ||
end | end | ||
</ | </ | ||
- | |||
- | See the documentation for funced and funcsave for ways to create these files automatically, | ||
- | |||
==== Variables Universales ==== | ==== Variables Universales ==== | ||
Línea 682: | Línea 677: | ||
nano | nano | ||
</ | </ | ||
+ | |||
+ | ===== Conclusión ===== | ||
+ | |||
+ | Has aprendido las grandes diferencias puntuales del shell Fish. ¡Felicitaciones! |