10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear Help,
Is it possible to continue the loop by going to the next available value, if the 'expected value' is not found. I have a list of values which might not get incremented by fixed value and hence the loop could break and the script could terminate.
Any suggestion is appreciated.
... (1 Reply)
Discussion started by: Indra2011
1 Replies
2. Shell Programming and Scripting
I am unable to use the value of a variable.
while ]
do
LstFldDataPart =`head -n "$LstFldDataPartCntr" "${FeedFileDir}/${FeedFileBadRecs}" | tail -1 | tr -d '\n'`
echo $LstFldDataPart
JndLstFldDataPart="${JndLstFldDataPart}${LstFldDataPart}"
LstFldDataPartCntr=... (3 Replies)
Discussion started by: TomG
3 Replies
3. UNIX for Dummies Questions & Answers
URGENT HELP IS NEEDED!!
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
- Also the matching lines are not moving out of File1.txt
... (1 Reply)
Discussion started by: High-T
1 Replies
4. Shell Programming and Scripting
can any1 please tell me what is problem with following code:
i=1;
cat test| while read CMD;
do
Var$i=$CMD; or Var$i=$(echo $CMD) ;
let i++
doneI keep getting error :
line 4: Var1=sometext: command not found (2 Replies)
Discussion started by: kashif.live
2 Replies
5. Shell Programming and Scripting
hey guys,
I tried searching but most 'search and replace' questions are related to one liners.
Say I have a file to be replaced that has the following:
$ cat testing.txt
TESTING
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
ENDTESTING
This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies
6. Shell Programming and Scripting
Hi All,
I have a simple script.sh file. It gives me " file.txt' for reading (no such file or directory)" Why can this happen?
%ls
ch1file.txt ch2file.txt ch3file.txt
% chmod +x script.sh
% bash
% ./script.sh
where script.sh is as follows
for i in seq(3)
do awk '{print $1}'... (1 Reply)
Discussion started by: senayasma
1 Replies
7. Shell Programming and Scripting
hi ,
I have certain files at the same path with differeent extensions like .dat , .txt etc ...........i need to rename them with extension .found at the same path with the help of loop....
also the files names will be like this ;
abc_2010_c1.dat
abc_2010_c2.dat
xyz_2010_c1.txt (2 Replies)
Discussion started by: amitpta
2 Replies
8. Shell Programming and Scripting
Hi,
I have a strange problem and I'm sure its because I'm doing something stupid.
When I loop through all of the files in a directory they cannot be found.
Any help would be greatly appreciated.
Thanks,
-E
$ touch a.txt
$ touch b.txt
$ ls
a.txt b.txt
$ for f in `ls` ; do... (3 Replies)
Discussion started by: earls
3 Replies
9. Shell Programming and Scripting
Hi I am trying to write a script which will loop through all files that end in ".txt" and ask user if they want to delete the file or not
#this print out all files
dir=/root/etc/
find $dir -name "*.txt"
output:
1.txt
2.txt
etc
but what i really want is
1.txt delete(Y/N):
2.txt ... (11 Replies)
Discussion started by: Calypso
11 Replies
10. Shell Programming and Scripting
I cannot seem to pass the value of the variable assigned in the "else" statment below to an "if" statement outside of the loop. When I debug using "set -x", I find that the value of "$A" is empty. Is there something I'm missing here? Code is below:
do
if ] then
echo "Good Match"... (2 Replies)
Discussion started by: douknownam
2 Replies