in Operating System recategorized by
1,579 views
3 votes
3 votes

Which of the following shell scripts will produce the output “my first script”?

  1. for i in my first script { echo –i $i }
  2. for my first script; do echo –n; done
  3. for i in my first script; do echo –i $i; done
  4. for n in my first script; do echo –i $i; done
in Operating System recategorized by
1.6k views

1 Answer

2 votes
2 votes
ans should be C  

for loop has control variable i which will be assigned he value after it  and do apply for loop to print it should be enclosed in do...done block

echo -i $i display the currrent  contents of i
Answer:

Related questions