Search Results

Search: Posts Made By: in2nix4life
4,719
Posted By in2nix4life
awk 'NR==FNR{a[$1]=$0;next}($3 in a){print}'...
awk 'NR==FNR{a[$1]=$0;next}($3 in a){print}' file1 file2
Forum: Linux 04-04-2014
4,779
Posted By in2nix4life
I don't believe there is a way to do this with...
I don't believe there is a way to do this with the chkconfig command, but you could try listing and sorting the contents of the /etc/rc.d/rc.*d directories to create an ordered list by priority of...
3,247
Posted By in2nix4life
# Print the file (print each element of the...
# Print the file (print each element of the array)
NUMBER=1
getArray "junk2"
for e in "${array[@]}"
do
project -C$e -A145 -G0.01k -L-2500/2500 -Q > junk3

cat junk3 | grdtrack...
10,766
Posted By in2nix4life
The following will read a file line-by-line....
The following will read a file line-by-line. Replace "users.txt" with the name and path to your file.


#!/usr/bin/expect -f
#

set fh [ open "users.txt" r]

set fileData [read $fh]

close...
Forum: Red Hat 07-31-2014
1,472
Posted By in2nix4life
The -p switch allows the rpm command to perform...
The -p switch allows the rpm command to perform actions on a standalone rpm package, whether it be on the local filesystem or remote (URL).

i.e.

rpm -qip filename.rpm

Will list the...
3,140
Posted By in2nix4life
Maybe something like this: zip...
Maybe something like this:


zip APP_Deg_Dummy_$(ls | head -n1 | awk -F_ '{print substr($2, 1, 8)"TM"substr($2, 10, 6)}').zip Dummytest_20140601W110515_file*
adding:...
1,325
Posted By in2nix4life
awk '/^>/{print...
awk '/^>/{print ">"$3;getline;print;getline;print}'
11,042
Posted By in2nix4life
awk '!a[$8]++' file
awk '!a[$8]++' file
1,530
Posted By in2nix4life
ls -l | awk '/^-/{print substr($0, index($0,$9))}'
ls -l | awk '/^-/{print substr($0, index($0,$9))}'
1,332
Posted By in2nix4life
sed -r 's#(\w+)com#\1\.com#g' infile
sed -r 's#(\w+)com#\1\.com#g' infile
1,538
Posted By in2nix4life
awk '{for(a=0;a<$1;a++) print $2}' infile
awk '{for(a=0;a<$1;a++) print $2}' infile
1,710
Posted By in2nix4life
awk '{match($0,/FROM (\w+\.\w+)/,a); print a[1]}'...
awk '{match($0,/FROM (\w+\.\w+)/,a); print a[1]}' infile
7,586
Posted By in2nix4life
awk '{a[b++]=$0;}END{print a[int(b/2)];}' infile
awk '{a[b++]=$0;}END{print a[int(b/2)];}' infile
1,246
Posted By in2nix4life
sed 's/>/ /3' file
sed 's/>/ /3' file
7,493
Posted By in2nix4life
Try removing the pipe (|) symbols from your sed...
Try removing the pipe (|) symbols from your sed expression.

Also, if the goal is to have just a line of dashes, you could just globally replace the underscore character.


echo...
11,541
Posted By in2nix4life
Just add a space at the end of the pattern: ...
Just add a space at the end of the pattern:


echo 'String#1 and String#2' | egrep -o -m 1 'String#.{1} '
String#1
4,303
Posted By in2nix4life
The format to delete a static route is: ...
The format to delete a static route is:


route del <ip address> netmask <subnet mask> gw <gateway> <interface>
Forum: Debian 04-16-2014
3,794
Posted By in2nix4life
To show which package a file belongs to: dpkg...
To show which package a file belongs to:
dpkg -S /usr/lib/rtkit/rtkit-daemon | awk -F: '{print $1}'
rtkit

To show package information:
apt-cache show rtkit
2,208
Posted By in2nix4life
If available on your flavor of 'nix, you can use...
If available on your flavor of 'nix, you can use the shuf command:


shuf -n 1 -i 40-70
3,572
Posted By in2nix4life
You can use the env command in your shebang line....
You can use the env command in your shebang line. I write scripts for Solaris, AIX, and Linux and using that command will locate the interpreter on the given system:


#!/usr/bin/env bash
21,649
Posted By in2nix4life
Some critiques: Try putting spaces between...
Some critiques:

Try putting spaces between your print commands (i.e. print "GRAND TOTAL") and quotes.
The third line in the workers file is missing a department.
The calculations are off using...
2,367
Posted By in2nix4life
Show what you're running that produces that error.
Show what you're running that produces that error.
2,367
Posted By in2nix4life
That seems straightforward enough, however, you...
That seems straightforward enough, however, you list three different files (see below). Please explain further.


Sfile=/u01/scripts/Sfile.log
Pfile=/u01/scripts/Pfile.log...
2,367
Posted By in2nix4life
If you're using GNU Sed sed --version |...
If you're using GNU Sed


sed --version | grep GNU


this should take care of all three in the file:


sed -r '/^$|-|PRCSINSTANCE/d' file
2,367
Posted By in2nix4life
Try adding set -x to the top of your script below...
Try adding set -x to the top of your script below the #!/bin/sh line, run it again, and provide the output.


#!/bin/sh
set -x
Showing results 1 to 25 of 162

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