10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All ,
New to the Bash / Shell programming world and looking for some help
I have two files
1: Contains a list of names :
eg
STEVE
BOB
CRAIG
2: Contains information with those included names but also others that are not in the list (1 Reply)
Discussion started by: Lonerg550
1 Replies
2. Shell Programming and Scripting
I have a python script that gives output called test.png. By using the following command I run the script every 2 seconds. What is the easiest way to save the output as follows ( test.png (1st output), tes1.png (second output), tes2.png ....)
Command I i use
while sleep 2; do python... (1 Reply)
Discussion started by: quincyjones
1 Replies
3. UNIX for Dummies Questions & Answers
I found this command and would like to know what it means:
gawk 'NR==1{for(i=1;i<=NF;i++)if($i~/FE/)f=i}{for(i=0;i<n;i++)printf"%s%s",i?" ":"",$f;print""}'
It seems to mean if the row =1 assign i to that row, and then if FE is in the top row /column then increment and print the row.
I am... (2 Replies)
Discussion started by: newbie2010
2 Replies
4. UNIX for Advanced & Expert Users
I was thinking something like this but it always gets rid of the file location.
grep -roh base. | wc -l
find . -type f -exec grep -o base {} \; | wc -l
Would this be a job for awk? Would I need to store the file locations in an array? (3 Replies)
Discussion started by: cokedude
3 Replies
5. Shell Programming and Scripting
OS : RHEL 6.1
Shell : Bash
I have lots of files in /tmp/stage directory as show below.
Using a loop, I need to print all the filenames in this directory except those ending with a number. How can I do this ?
# pwd
/tmp/stage
#
#
# ls -l *
-rw-r--r--. 1 root root 0 Oct 7 18:38 stmt1... (2 Replies)
Discussion started by: kraljic
2 Replies
6. Shell Programming and Scripting
Is it possible to modify file like this.
1. Remove all the duplicate names in a define column i.e 4th col
2. Count the no.of unique names separated by ";" and print as a 5th col
thanx in advance!!
Q
input
c1 30 3 Eh2
c10 96 3 Frp
c41 396 3 Ua5;Lop;Kol;Kol
c62 2 30 Fmp;Fmp;Fmp
... (5 Replies)
Discussion started by: quincyjones
5 Replies
7. Shell Programming and Scripting
Hi All,
I have some thousand files with names like 1.syl, 2.syl, 5.syl etc.
These files contain one sentence each. I want to store all those sentences along with the file ID that is 1, 2, 5 with the sentences they contain.
For example,
1.syl has
this is a test line
2.syl has
... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
8. Shell Programming and Scripting
Hi,
Can anyone tell me how to print the column name anong with the value from the table in shell script e.g
#!/bin/ksh
var=`sqlplus scott/tiger << -e
set heading off feedback off
select * from emp;
quit;
e`
echo $var
My output should be;
... (5 Replies)
Discussion started by: thana
5 Replies
9. Shell Programming and Scripting
Hello all
Im doing search in jar files using this oneLiener :
find . -name "*.jar" -print -exec jar -tvf {} \; | grep -n \/someClassName.class
but I also will like to see the jar file names that the grep succeed the search
What I need to add to this command so it will give the file names? (2 Replies)
Discussion started by: umen
2 Replies
10. UNIX for Dummies Questions & Answers
I need to list only file names of a specific date from the command ls -lt.
:confused: (2 Replies)
Discussion started by: Shamwari
2 Replies