I have a file named toto.sh and the content of the file is:
#!/bin/sh
for i in $(seq 1 100);
do
echo "CREATE TABLE test_$i (id NUMBER NOT NULL);
! sleep 10
select * from test_$i;
! sleep 10
DROP TABLE test_$i;" | sqlplus system/mypassword &
done
I execute the bash script:
./toto.sh
Now i am trying to search the process like so:
pgrep -f toto.sh
ps -ef | grep toto.sh
ps aux | grep toto.sh
And i am getting no relevant results:
root 24494 15043 0 10:47 pts/5 00:00:00 grep toto.sh
However, I can see via pgrep etc. the sleep and sqlplus processes fired up through the script,
What am i doing wrong here?