Bash tips and trick
Saturday, February 04, 2006
How to get the parent directory of a folder
$ dirname `pwd`
In shell script:
VAR=${dirname `pwd`}
posted by Arthur Kho Caayon at
2:44 AM
1 Comments:
Unknown
said...
${dirname `pwd`}: bad substitution
5:06 PM
Post a Comment
<< Home
Previous Posts
Special characters and operators
Print only line 58 of a text file: $ sed -n '...
Batch renaming of files $ rename 's/\s+/_/g' *.mp3...
The set command #!/bin/shset `date`echo "Time: $4 ...
Positional parameters myscript.sh: #!/bin/shecho $...
Ignore case in grep $ grep -i 'camelCaseWhatever' ...
sed: Swap two words around $ cat testfirst:secondo...
sed: Enclose a word in angle-brackets s/html/<&>/ ...
Delete all lines in a file that begins with 'O' $c...
Strip off file extension ${filename%.*} Example:$ ...
1 Comments:
${dirname `pwd`}: bad substitution
Post a Comment
<< Home