Home > database >  interprete error: No such file or directory [Bash]
interprete error: No such file or directory [Bash]

Time:12-05

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 "${@}".

  •  Tags:  
  • bash
  • Related