I have a bash function as follows:
function folderSize{
du -hs | awk '{print $1}'
}
folderSize
When I run it I get the following error:
./size.sh: line 2: syntax error near unexpected token `du' ./size.sh:
line 2: ` du -hs | awk "{print $1}"'
Can any one help me?
space is required before the {.
Also, the way you call the function is just
folderSize, no dollar sign, no parentheses.