for loop in bash script on solaris without seq
2010-06-11
70 words
1 min read
Today I was working on a solaris box and wanted to do a watch. watch command is not available on Solaris 8 by default and I did not want to install it just for this small one time job. So I wrote this:
for (( i=0; i<=100; i++ )); do ls -lrt /tmp/amit*; sleep 2; done
You can replace the command in bold with whatever command you want to watch.
Related Articles:
- 2010/06/06 colors in bash – script to display all the possible colors.
- 2010/05/19 Solaris Tips and Tricks
- 2010/05/12 Linux tip to find the pid/program using a particular port
- 2010/05/06 View entire process string
- 2010/03/25 Running Nested X server
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.