I'm starting with bash scripting, but I can't execute any code due to this error, here is an example of a basic code:
#! /bin/bash/
for x in $#
do
echo $x
wc - l $x
Done
I'm on a virtual machine on Linux Fedora.
CodePudding user response:
A summary with minor improvements/changes to the formatting:
#!/bin/bash
for x in $#; do
echo "$x"
wc -l "$x"
done
I guess $#
is still to be replaced by "${@}"
.