|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Script help
I need to make a unix script that takes a directory as a arguement, and then print out all of the files in that directory in 2 columns. -Thanks
|
|
#2
|
|||
|
|||
|
Although this looks a bit like homework to me, I'll be nice for once
![]() Code:
#!/bin/bash
INPUT="$1"
ls -x ${INPUT}
|
|
#3
|
|||
|
|||
|
I think the question was to print file names in 2 not (to :-))
columns. This script will do th printing in 2 columns #!/bin/sh j=0; for i in `ls -1 $1` do echo "$i \c" j=`expr $j + 1` k=`expr $j % 2` if [ $k -eq 0 ] then echo "" fi done
__________________
Regards JK |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Script help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|