Anonymous

Not logged in

  • Log in
DWIKI

Bash

From DWIKI

Namespaces

  • Page
  • Discussion

More

  • More

Page actions

  • Read
  • View source
  • History
Revision as of 09:45, 11 January 2018 by Tony (talk | contribs) (→check if var contains substring)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • Homepage
  • http://www.linuxdoc.org/HOWTO/Bash-Prog-Intro-HOWTO.html
  • Shortcuts to move faster in Bash command line
  • Bash Guide for Beginners
  • http://www.ling.helsinki.fi/users/reriksso/unix/shell.html
  • Advanced Bash Scripting Guide
  • Linux Shell Scripting Tutorial
  • Aliens Bash Tutorial
  • http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/
  • Bash Keyboard Shortcuts

Contents

  • 1 Tips and tricks
    • 1.1 get first character of a string
    • 1.2 check if var contains substring
    • 1.3 move cursor
    • 1.4 loops
      • 1.4.1 loop through range of numbers

Tips and tricks

get first character of a string

FIRST=${STRING:0:1}

check if var contains substring

[[ $foo =~ .*sub.* ]]

move cursor

^b move back 1 char
^f move forward 1 char
alt-b move back 1 word
alf-f move forward 1 word

loops

loop through range of numbers

for i in {0..10};do echo $i;done
Retrieved from "https://wiki.dhits.nl/index.php?title=Bash&oldid=5519"
Categories:
  • Scripting
  • Programming

Navigation

Navigation

  • Main Page
  • Community portal
  • Recent changes
  • Random page
  • Help

Wiki tools

Wiki tools

  • Cargo data

Page tools

Page tools

    User page tools

      More

      • What links here
      • Related changes
      • Printable version
      • Permanent link
      • Page information
      • Page logs

      Categories

      Categories

      • Scripting
      • Programming
      • Powered by MediaWiki
      • This page was last edited on 11 January 2018, at 09:45.
      • Privacy policy
      • About DWIKI
      • Disclaimers