Helping a Newbie with Shell Homework


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Helping a Newbie with Shell Homework
# 1  
Old 10-28-2015
Helping a Newbie with Shell Homework

Good Evening,

i got a homework where i have to list all files in the directory with the name length >=3 and <= 6 and after trying it for 2 days my Prof gave me a bit of code:
#!/bin/bash

for file in $(ls)
do

done

after that he told me "now you only have to use wc and you got it" but i dont get what to do ._. its freaking me out
can someone help me :/
# 2  
Old 10-28-2015
As you have done so honestly you are quite welcome to get help with your homework here, but still must post in the homework forum following the special homework rules. This means naming your school and course, etc. This is the only way we can help homework.

for variablename in $(giant pile of lines of unknown size and composition) is a terrible habit fwiw, prone to several misbehaviors and breakdowns.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with spawn.. newbie to shell

Hi, I have a problem with the spawn execution with expect.. i have done the code for expect in a separate file and i am calling the this execution from the bash script.. as given below.. -bash-4.1$ cat main.sh #!/usr/bin/bash ./spawn.exp ========================== -bash-4.1$ cat... (2 Replies)
Discussion started by: satishkumar432
2 Replies

2. Shell Programming and Scripting

cut operation is not helping me much

hi, i have a file where I want to extract the the failure count only from the file. JOB_NAME STATE RUN_COUNT FAILURE_COUNT ------------------------------ --------------- ---------- ------------- OFS_BALA_BILLING_IN SCHEDULED 22992 ... (6 Replies)
Discussion started by: gotam
6 Replies

3. Shell Programming and Scripting

Shell Script for a newbie

Hello all, I want to write a shell script to list the contents of a directory and number them and write them to a file. For example, if I have a directory temp and the contents of the directory are alpha, beta and gamma. I want to write these filenames to a file "test" in a numbered manner. ... (7 Replies)
Discussion started by: grajp002
7 Replies

4. Shell Programming and Scripting

Shell Scripting NEWBIE - Need Help

Could someone please recommend a very good shell scripting book for me. I would be starting a new job that would require a very good understanding of shell scripting. Please help. (3 Replies)
Discussion started by: ayoka
3 Replies

5. IP Networking

helping new Linux users remotely ?

I volunteer with a small charity which locally donates refurbished computers to people who normally could not afford their own computer. Most of these computers now have Linux on them. We are in the process of remastering Xubuntu 9.04 to use as our main distro from now on. In the past any time... (3 Replies)
Discussion started by: lagagnon
3 Replies

6. Shell Programming and Scripting

Shell Script Help -I'm a newbie

Can someone help me write this shell script? I am completely new to shell and as a fun task my uncle has challenged me a problem (out of all other people). Basically, all he wants me to do is to create backup file in a folder that is named “disables.” This is what he said: create a shell script... (0 Replies)
Discussion started by: hotcutiepie05
0 Replies

7. UNIX for Dummies Questions & Answers

Shell Scripting Newbie

I'm relatively new at this scripting game, just need to learn some basic stuff for data handling. My current need is to write a script that loops through a textfile of filenames, and for each file removes the first line and re-writes that file to a new name. In fact I could do with knowing... (1 Reply)
Discussion started by: mattyjim2
1 Replies

8. Shell Programming and Scripting

Need a helping hand --stuck in starting of this problm.

Hi all it is a real challenge for me to do it in 2 days any help or suggestion will be a great ! Problem : I have 17 - CSV files (Coma separated value) each file conating around 26 column the first line of each of the file conatin the field name and from second line the file contain data for... (13 Replies)
Discussion started by: jambesh
13 Replies
Login or Register to Ask a Question