Search Results

Search: Posts Made By: ajp7701
3,301
Posted By ajp7701
I tryed, then using $FN instead of $LINE for that...
I tryed, then using $FN instead of $LINE for that example....and yes, that is what I needed...seems like it will work great. I'm not sure why the difference...?
3,301
Posted By ajp7701
yes. I am aware that filenames could have spaces....
yes. I am aware that filenames could have spaces. but in this case they will NEVER have spaces, or numbers, or characters. all lower case text, no spaces.
yes a loop would probably be definite...
3,301
Posted By ajp7701
Script to cp files that user inputs
Need a bash script that will ask the user: Which Files Would you like to copy?
Then the user would input the filenames (space seperated, all lowercase)
The script would then cp each file to...
4,524
Posted By ajp7701
yes that is 3. I cut and pasted, I dont know how...
yes that is 3. I cut and pasted, I dont know how that happened. ?? SRRY :(
4,524
Posted By ajp7701
awk line instance counter
I Have a text file with several thousand lines of text.
Occasionally there will be a "sysAlive" line of text (every so often)
What would be an awk command to print every line of text, and to put in...
2,286
Posted By ajp7701
NICE!! thanks so much!
NICE!! thanks so much!
2,286
Posted By ajp7701
awk '{if $3=999 print $0}' INPUT.TXT > OUTPUT.TXT...
awk '{if $3=999 print $0}' INPUT.TXT > OUTPUT.TXT

I know that probably wont work...but it helps get the idea out there of what we need (hope)
2,286
Posted By ajp7701
Print ALL lines except if field is 999
Hi All!!! :-)

I need a command that will print each line of a text file UNLESS the 3rd field of that line is equal to the number 999. (space seperated fields)

Solaris10/BASH SHELL:

INPUT.TXT...
1,113
Posted By ajp7701
this works...
its pretty simple really...here is the command that seems to work in bash. I guess i was just wondering if there was a c-shell way of doing it?


for file in `ls -1 /home/dir`; do grep $file...
1,113
Posted By ajp7701
List files in dir and grep accordingly
bash or c-shell On Solaris 10

I need a command that will list the files of a directory, and grep each of those filenames out of a static text file, and then only echo field 2 of the static text...
1,926
Posted By ajp7701
Search for words NOT in a text file
I have a long list of alphanumberic words (no spaces or characters) in file1.txt I need to check for the existance of each of the words from file1.txt against file2.txt and if the word is NOT in...
1,176
Posted By ajp7701
Echo all numbers in file +/-1
I have a plain text file,

344 392 352 341
405 327 456 765
234 457 874 154
.
.
301 356 789 554

I need a bash script or command (Solaris 10 or Fedora 18) that echos or prints each of the...
2,145
Posted By ajp7701
theres hundreds of vars
typing them out again is really not an option. I was hoping for a slick way to do this. I think I need to research arrays

All I seem to be able to do is echo the value of the variable, which makes...
2,145
Posted By ajp7701
echo the NAME of the variable
#!/bin/bash
varA="AAA1"
varB="BBB2"
varC="CCC3"
for proccx in $varA $varB $varC
do
echo "the current name is ????? , the value is $proccx"
echo " "
done
#end of script
I want the output to...
1,933
Posted By ajp7701
if ps -p 1234 reports nothing, echo something
I have a script that I need to put in some checking. It would read something like this but I need help with the exact notation:

#!/bin/bash
while true
if [ -z `ps -p 1234` ] #process is no...
57,003
Posted By ajp7701
foreach in bash (simple)
#!/bin/bash
foreach valuex ( word1 word2 word3 word4 )
echo $valuex
done

the output should be:
word1
word2
word3
word4

HOW DO I MAKE THIS WORK?
6,537
Posted By ajp7701
SOLARIS 10
the above script by Chubler_XL works great. The only issue is that the process names (process1, process2, process3) are not always very unique, and often just using the unique part of the name will...
6,537
Posted By ajp7701
thank you
now wheres that thank-you button?
6,537
Posted By ajp7701
ps -elf AND grep for changes
Hoping theres something already out there like this.

I have a list of proccesses who's "ps -elf" (field 10) values I need to continuously monitor and if the values of field 10 start to...
4,231
Posted By ajp7701
Add all file sizes in ls -l
solaris 10 (c shell)

need a command or script that will add up all (*.tmp) file sizes in bytes of a single directory, or kbytes, no matter
4,104
Posted By ajp7701
PERFECT
Ok, these are all great! AWK is great for this. It amazes me how smart and elegant everyone is with awk.

Now, what if I want to print a number for each time a duplicate field1 was removed? For...
4,104
Posted By ajp7701
sample input/output
---

input
2012 aaa bbb cccc ddd
2012 eee fff ggg hhh
XYZ aaa bbb ccc ddd
XYZ eee fff ggg hhh <---remove this line
2012 hhh iii jjj
2012 hhh iii 123
ABC mmm nnn ooo
ABC ppp qqq rrr...
4,104
Posted By ajp7701
Remove lines with duplicate first field
Trying to cut down the size of some log files. Now that I write this out it looks more dificult than i thought it would be.

Need a bash script or command that goes sequentially through all lines...
1,131
Posted By ajp7701
Character generation
I need a (bash) script to echo to the screen all possible 4 character hex combinations of: A-F, 0-9. I beleive there are 65,535 approx combos. Output something like this:

0001
0002
0003
0004...
2,809
Posted By ajp7701
only print line if 3rd field is 01
Similar question... I have a space delimited text file and I want to only print the lines where the 3rd word/field/column is equal to "01"
awk '{if $3 = "01" print $0}'
something like this.
I...
Showing results 1 to 25 of 94

 
All times are GMT -4. The time now is 04:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy