10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Good morning all,
This is the file name in question OD_Orders_2019-02-19.csv
I am trying to create a bash script to read into files with yesterdays date on the file name while retaining the rest of the files name. I would like for $y to equal, the name of the file with a formula output with... (2 Replies)
Discussion started by: Ibrahim A
2 Replies
2. UNIX for Beginners Questions & Answers
Hi There
Just created a .sql script and executes fine, it comes back with two lines of results, I was wondering is there a way of adding up the two results to get a round number. I tired wc -l but that didn't work.
Many Thanks for your help
psql -t -f... (3 Replies)
Discussion started by: simpsa27
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am trying to use awk to do the following:
For a column:
5
3
4
2
7
I want to start with the first entry then add the second to the first, third to second ..etc:
5
8
12
14
21 (5 Replies)
Discussion started by: cosmologist
5 Replies
4. Shell Programming and Scripting
Hello guys,
I have been looking around but can't find the answer to my problem:
If the grep command displays no results, print "no results have been found" and increment x. But if the grep command find something, do nothing.
if
echo "no results have been found $x"
x=`expr $x + 1 `... (3 Replies)
Discussion started by: Benou
3 Replies
5. Shell Programming and Scripting
I'm trying to add the paths of all the xml files in certain directories to an array. I want to use the array later in my code. Anyway, for some reason this isn't working. Any help would be appreciated.
Path_Counter=0
for result in "find * -name '*.xml'"; do
XmlPath="$result"
echo... (2 Replies)
Discussion started by: Fly_Moe
2 Replies
6. Shell Programming and Scripting
Hi there
If I run a 'swap -l' on my solaris box, i get
swapfile dev swaplo blocks free
/dev/dsk/c1t0d0s1 54,65 8 67119560 65655144
/dev/dsk/c1t0d0s2 54,65 8 33119522 32655122
I wanted to run a for loop adding up the totals of each column 4 , excluding the... (2 Replies)
Discussion started by: hcclnoodles
2 Replies
7. UNIX for Dummies Questions & Answers
I want to display "no results found" if a grep search of a name that the user inputs is not found anywhere in a certain file,
Right now I have this, but doesn't seem to work. Im not sure what to change.
read name
results=grep -c $name file
if ;
then echo "No results found."
exit... (1 Reply)
Discussion started by: busdude
1 Replies
8. Shell Programming and Scripting
I have the results of a grep with -n store in a shell variable
ie
VAR=`grep -n -e 'PATTERN' file`
How ever I am missing the line breaks in the variable , How do I store the resualts of grep with many lines in to a variables. I want the varable should be the sawmway as we do the grep
grep... (3 Replies)
Discussion started by: jojan
3 Replies
9. UNIX for Dummies Questions & Answers
Hi
I need to search for matching strings in a database and I want to print out all files that matches in "detail", which means that I want the output to contain datum of last saving. I only get the grep function tp print the actual file names which is not enough since the database is to large... (14 Replies)
Discussion started by: slire
14 Replies
10. Shell Programming and Scripting
I need help to further reduce the output shown below. I want to be able to only return the paragraph where the 'Database alias' is exactly equal to DBIHP. I do not want the other paragraphs being shown below.
$ echo $dbalias
DBIHP
$ db2 list db directory|grep -p 'Database alias ... (2 Replies)
Discussion started by: priceb
2 Replies