Bash tips and trick
Sunday, February 12, 2006
${#string} Getting the length of a string
$ WORD=Supercalifragilisticexpialidocious
$ echo $WORD
Supercalifragilisticexpialidocious
$ echo ${#WORD}
34
posted by Arthur Kho Caayon at
1:36 AM
0 Comments:
Post a Comment
<< Home
Previous Posts
${var=default} If var is not set, set it to default
${var-default} If var is not set, use a default
If arg is empty print the current working director...
How to get the parent directory of a folder
Special characters and operators
Print only line 58 of a text file: $ sed -n '58...
Batch renaming of files$ rename 's/\s+/_/g' *.mp3R...
The set command#!/bin/shset `date`echo "Time: $4 $...
Positional parametersmyscript.sh:#!/bin/shecho $0 ...
Ignore case in grep$ grep -i 'camelCaseWhatever' f...
0 Comments:
Post a Comment
<< Home