10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Greetings. I am working in a Linux environment and am trying to figure out a way to rename files in a directory by appending a unique strings that appears within a certain area in those files. I have gotten as far as identifying what that particular unique string is with a command like the... (10 Replies)
Discussion started by: HLee1981
10 Replies
2. Shell Programming and Scripting
I call my bash shell script "test.sh" and pass "admin_usr.txt" as an argument like below.
./test.sh admin_usr.txt
Inside the "test.sh" i wish to check if the filename passed "admin_usr.txt" i.e "$1" contains the string "admin" or not ... which in this case it does.
Note: I do not wish to... (5 Replies)
Discussion started by: mohtashims
5 Replies
3. Shell Programming and Scripting
I want to search a file if it contains special strings and if yes, the records found should be mailed.
I can either do it with a temporary file:
/usr/bin/grep somestring somefile > /tmp/tempfile && /usr/bin/mail -s "Found something" email@mycomp.com < /tmp/tempfile... or by running the grep... (10 Replies)
Discussion started by: Cochise
10 Replies
4. Shell Programming and Scripting
Hi all.. I have several unique files that contain one thing in common, and that is acct#. For all files in the directory, I want to append the 10 characters following the word "ACCOUNT:" to the end of the filename.
for example:
I have file 111_123 that contains ACCOUNT:ABC1234567
The file... (5 Replies)
Discussion started by: cinderella1
5 Replies
5. Shell Programming and Scripting
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies
6. Shell Programming and Scripting
Hi i want to write a script that will search a filename e.g. test06abc.txt for a string and if it contains this string then set a variable equal to something:
something like:
var1=0
search <filename> for 06
if it contains 06 then
var1=1
else
var1=0
end if
but in unix script :) (4 Replies)
Discussion started by: tuathan
4 Replies
7. Shell Programming and Scripting
hi
i need to rename a.txt to a_12052008.txt using the batch file
i used reanme a.txt a_%date%.txt ......but its done nothing
am using win2000 professional edition.
system date format is : The current date is: Mon 2008-05-12
can anyone help me to rename
thanks
aemu (5 Replies)
Discussion started by: aemunathan
5 Replies
8. Shell Programming and Scripting
Hello,
I have over 200 files and some of them have the string like "John price $200". I would like to grep the string. Then output the filename which found the string.
I have the following script, but it ONLY output the string
echo Please input list file name:
read listn
for file in `cat... (3 Replies)
Discussion started by: happyv
3 Replies
9. Shell Programming and Scripting
Hi,
I need to append string "Hi" to the beginning of the lines containing some specific string. How can I achieve that?
Please help.
Malay (1 Reply)
Discussion started by: malaymaru
1 Replies
10. Shell Programming and Scripting
I'm currently digging for a way to append a line to a text file where each line begins with the word "setmqaut". This is a continuation of my IBM MQSeries backup script I'm working on to make my life a little easier.
What I would like to do is have each line that looks like this:
setmqaut -m... (4 Replies)
Discussion started by: sysera
4 Replies