10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm taking a unix class and need to countdown to 0 from whatever number the user inputs. I know how to do this with a while or until loop but using the for loop is throwing me off....
I know I can use an if-then statement in my for loop but can I include a while loop in my for loop? (3 Replies)
Discussion started by: xxhieixx
3 Replies
2. Shell Programming and Scripting
Hi ,
I'm trying to move/copy the files inside the loop into a directory .
I tried the below code and the issue is the data is not copying into the created directory but the files are copying into another file
file_path="/home/etc"
Last_Day=20130930
mkdir $file_path/ARC_${Last_Day}
... (3 Replies)
Discussion started by: smile689
3 Replies
3. Shell Programming and Scripting
Hello,
I have a set of files Xfile0001 - Xfile0021, and the content of this files (one at a time) needs to be printed between some line (lines start with word "Generated") that I am extracting from another file called file7.txt and all the output goes into output.txt. First I tried creating a for... (5 Replies)
Discussion started by: jaldo0805
5 Replies
4. Shell Programming and Scripting
There are 4 files inside one folder matching criteria i.e. File name = ABCJmdmfbsjopXXXXXXX_mm-dd-yyyy_XXX.data
Here is the Code which find the files matching criteria:-
TS=`date +"%m-%d-%Y"`| for fname in `find . -name "ABCJmdmfbsjop???????_${TS}*.data"`
do # Matching File Processing Code.... (1 Reply)
Discussion started by: lancesunny
1 Replies
5. Shell Programming and Scripting
Basically, I have a user input a colour into a variable, and then i echo that variable into a text file. Then I need to compare those 2 files which is easy using the diff command. The thing I can not get is how to do this inside of a loop until the variable matches the file. Also if the user enters... (6 Replies)
Discussion started by: cstadnyk1
6 Replies
6. Shell Programming and Scripting
I am looking to a solution to the following problem. I have a very large file that looks something like this:
Each group of three numbers on each line are three probabilities that sum to one.
I want to output the maximum for each group of three. So desired output would be:
or... (6 Replies)
Discussion started by: hydrabane
6 Replies
7. Shell Programming and Scripting
I am no Unix administrator...I live in windows land.
I wrote a script to find files of certain names and process them but was later advised to avoid checking sparse files since it would use up a lot of resources and the files I was looking for were not there.
How do I avoid doing the find on... (3 Replies)
Discussion started by: shellFun
3 Replies
8. Shell Programming and Scripting
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Discussion started by: rethink
4 Replies
9. Shell Programming and Scripting
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies
10. Shell Programming and Scripting
hey guys,
I'm trying to call and modify multiple files inside the for loop, i can't get it to work...
------------------------
AFILE=/dir/a_file.txt
BFILE=/dir/b_file.txt
CFILE=/dir/c_file.txt
ADESTFILE=/dir/a_dest_file.txt
BDESTFILE=/dir/b_dest_file.txt... (6 Replies)
Discussion started by: DeuceLee
6 Replies