Search Results

Search: Posts Made By: smiley76112
2,753
Posted By smiley76112
Shell script to remove files
I am working in directory week5 and I want to delete the files in directory week1, without leaving directory week5. I understand that rm is used to delete a file, but how do you remove them while...
1,873
Posted By smiley76112
Thanks
I'll try this.:cool:

---------- Post updated at 10:47 PM ---------- Previous update was at 08:39 PM ----------

Ok I have to write a script to make this work:

!#/bin/bash

read -p "Enter...
1,873
Posted By smiley76112
Remove files
I know that rm -i, asks a user before removing a file. What I need to accomplish is removing files from a different directory without switching to that directory. Example: I'm currently in directory...
4,437
Posted By smiley76112
Like idea
While I like your idea, the program has to list the files so the user can choose one to view. That's why I figured using nested while loops would work.
4,437
Posted By smiley76112
Next part
Now it must ask the user for a file from list of week submissions. Do I put the next while loop within the original loop or after it? Here's the loop:
while [ $file != "q" ];
do
if [ -f...
4,437
Posted By smiley76112
Help
Not sure why it won't work, but I tried agama's suggestion and it still won't work. Any other suggestions.
4,083
Posted By smiley76112
POS 420 Week 4 IA
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:

<LI...
4,437
Posted By smiley76112
Code for enter q to quit
echo "Enter week number or q to quit: "
read num
while $num != q
do
if [ $num -lt 4 ]
then
echo "The files submitted in week $num are"
ls...
4,437
Posted By smiley76112
Enter q for quit not working
I'm using a while loop with an if statement. When the user choses a number, it will display a list of files. That works, the problem is q for quit won't exit script. How can I fix this?
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy