$ ksh test.ksh
find: expected an expression after '-o'
test.ksh[11]: -name: not found
test.ksh[12]: syntax error: `do' unexpected
however I have tried your simple code at those work
now I am trying to work around it in a different directory but dont manage it...
i know this one should be a stupid mistake but cant find where it is
Getting this error means that you added something after the backslash (\)in test.ksh at the end of this line in the script I gave you:
The backslash character in that line has to appear just before the newline that terminates that line.
Quote:
Originally Posted by A-V
however I have tried your simple code at those work
now I am trying to work around it in a different directory but dont manage it...
i know this one should be a stupid mistake but cant find where it is
You don't say how it is failing, but there are several obvious problems here.
Using f as the variable name in two nested for loops can't possibly be what you want. Setting name and never using it seems pointless. If you'd like to provide more details about what you're trying to do with this nested loop we may be able to help.
If you just want the script to do the same processing in a different directory, the simple thing to do is:
and then run the script again.
Thank you so much for your guidance and help.... very useful
for the code, I have realized there is a problem with the system I am working as it those not read any type of them.
However, I did manage to make the simple code work...
I didn't wanted to go in a sub-directory so changed the FOR LOOP to IF LOOP to solve that problem.
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Hello.
For a given folder, I want to select any files find $PATH1 -f \( -name "*" but omit any files like pattern name ! -iname "*.jpg" ! -iname "*.xsession*" ..... \) and also omit any subfolder like pattern name -type d \( -name "/etc/gconf/gconf.*" -o -name "*cache*" -o -name "*Cache*" -o... (2 Replies)
Since my last threads were closed on account of spamming, keeping just this one opened!
Hi,
I have the following reports that get generated every 1 hour and this is my requirement:
1. 5 reports get generated every hour with the names
"Report.Dddmmyy.Thhmiss.CTLR"... (5 Replies)
Hello!
I have a question about how to combine patterns in grep commands with the OR operator.
So I have this little assignment here:
Provide a regular expression that matches email addresses for San Jose City College faculty. A San Jose City college faculty’s email address takes the form:... (1 Reply)
he following are the files available in my directory
RSK_123_20141113_031500.txt
RSK_123_20141113_081500.txt
RSK_126_20141113_041500.txt
RSK_126_20141113_081800.txt
RSK_128_20141113_091600.txt
Here, "RSK" is file prefix and 123 is a code name and rest is just timestamp of the file when its... (7 Replies)
Hi
I need to copy a huge directory with thousands of files onto another directory but without *.WMV files (and without *.wmv - perhaps we need to use *.).
Pls advise how can I do that.
Thanks (17 Replies)
Hi All,
Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below,
1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
Hi all,
I have been searching online to find the answer for getting a list of files that do not match certain criteria but have been unsuccessful.
I have a directory that has many jpg files. What I need to do is get a list of the files that do not match both of the following patterns (I have... (21 Replies)
hi all
suppose in particular directory i have lots of directory supoose
201009 201010 201011 201012
now by mistake i have rename all these directory as
201009.bk 201010.bk 201011.bk 201012.bk
now how can i revert the changes back
pls help me regarding this (2 Replies)
Hello,
I have several files in a specific directory.
A specific string in one file can occur in another files.
If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string.
Example.
file1
ShortName "Blue... (2 Replies)