while running this code , I get this error:
syntax error near unexpected token (' touch FILE$i FILE($i+1);'
what is wrong ?
#!/bin/bash
for ((i=1; i<=99; i++ ));
do
touch FILE$i FILE($i+1);
ln -s FILE$i FILE($i+1);
done
ln -s FILE 1 FILE2, you do not need to touch FILE2 first. Your code is trying to make a chain of symbolic links. Are you sure you want that, or do want FILE2,..,FILE99 all linked to FILE1. In that case you might wanttouch FILE1; for ((i=2;i<=99;i++));do ln -s FILE$i; done.