01-24-2007
ls and take each file as argument
I have LOGFILES=`ls *.log` and want to egrep each entry of LOGFILES one after the other:
egrep $LOGFILE....
how to do that??
thx
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
this is the only way i can think of to do this but there must be a better way or else im gonna end up writing 200 lines of copy and pasting code.
echo ' READ WRITE EXECUTE'
own=$(ls -al $1 |cut -c2)
if ($own==r) then
first=yes
else
first=no
endif
echo $first
Im writing a... (1 Reply)
Discussion started by: iago
1 Replies
2. UNIX for Dummies Questions & Answers
How to find the last argument in a argument line? (4 Replies)
Discussion started by: nehagupta2008
4 Replies
3. Shell Programming and Scripting
Can someone please help me with this SHELL script?
I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1.
Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies
4. Shell Programming and Scripting
I am trying to delete lines from a file with the sed command.
I have two files. File a.txt 200,000 records. Here is a sample of the file.
File a.txt
2401ABC0212345678 plus 250 characters of other data
2401ABC0212345678 plus 250 characters of other data
2402ABC0212345678 plus... (3 Replies)
Discussion started by: robbanigan
3 Replies
5. Shell Programming and Scripting
If ($argv == “-debug”) then
Echo “in loop”
Endif
But this is not working. If I modify this code and remove “-“, then it works.
Similarly I am getting problem using grep command also
Grep “-debug” Filename
Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies
6. Shell Programming and Scripting
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies
7. UNIX for Advanced & Expert Users
Hi All,
I am running the script
VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt
result=`cat har1out.mytxt | grep $1'
echo $result
echo $1
{
if
then
echo pass
else
echo fail
fi (2 Replies)
Discussion started by: harsha85
2 Replies
8. Shell Programming and Scripting
Hi,
Is there any way that we can pass one file as one of the argument in shell script ? (1 Reply)
Discussion started by: Selva_2507
1 Replies
9. Shell Programming and Scripting
Hi all,
I have a a file which contains an oracle query. If this file is pushed into a shell script such as the below, it of course works fine.
#!/usr/bin/sh
su - oracle -c 'sqlplus -s / as sysdba <<EOF
@/home/cron/ORA/sql/T-ORA006-OracleSessions.sql
exit;
EOF
.
What i am after... (2 Replies)
Discussion started by: nms
2 Replies
10. UNIX for Beginners Questions & Answers
Hi,
This is the content of a file name "test.sh":
#!/bin/bash
if ; then
echo "I am Here"
fi
When runing the command:
./test.sh chair table
The echo command "I am Here" will appear only based on the second value, in other words only if the there is no file name "table" regardless if... (1 Reply)
Discussion started by: uniran
1 Replies