Search Results

Search: Posts Made By: ohagar
28,606
Posted By ohagar
gnu grep has the -B option ( lines before ) and a...
gnu grep has the -B option ( lines before ) and a -A option ( lines after ) as well. You may find this on your box as ggrep or something like that, otherwise you could certainly get the gnu grep out...
2,415
Posted By ohagar
Thank you for the new knowledge you have given me...
Thank you for the new knowledge you have given me re: how links actually work.

hagar
30,595
Posted By ohagar
# cat capitals.txt The quick Brown fox jumped...
# cat capitals.txt
The quick Brown fox
jumped Over the Lazy Dog

# for i in `cat capitals.txt`
>do
>echo $i | grep [A-Z]
>done
The
Brown
Over
Lazy
Dog


HTH
2,415
Posted By ohagar
finding links to a file
I am writing a shell script that needs to files that are links to on specific shell script.

e.g.

/usr/bin/a.sh

/home/mydir/a.sh --> /usr/bin/a.sh
/home/yourdir/a.sh --> /usr/bin/a.sh...
14,588
Posted By ohagar
Not sure why you need a loop head -1...
Not sure why you need a loop

head -1 list.txt > out.txt
echo sleep 5 >> out.txt
6,273
Posted By ohagar
cat <your file> | cut -d ' ' -f 1
cat <your file> | cut -d ' ' -f 1
25,293
Posted By ohagar
for i in `cat unproc.dat` do grep $i...
for i in `cat unproc.dat`
do
grep $i fs_full.dat >> unprocjull.dat
done

beware of the quotes around cat unproc.dat they are back tics(under the ~ usually) not quotes (under the double quotes "...
2,732
Posted By ohagar
ubuntu has cd images that will not install on...
ubuntu has cd images that will not install on your M$ machine but will allow you to scope out Linux in all its radiant beauty =)

cygwin is also an option
3,021
Posted By ohagar
This works in bash
$ cat a.a
01/01/08-001-23:46:18-01/01/08-23:50:43
01/01/08-003-23:45:19-01/01/08-23:55:49
01/01/08-005-23:52:18-01/01/08-23:58:52

$ sed 's/-00\([0-9]\)-/-CODE0\1-/' a.a > b.b

$ cat b.b...
1,310
Posted By ohagar
This may be too basic...
I am not sure what exactly you are asking. But user privs are defined at a file level.

A user has privs to directories and files as seen when one does :
$ ls -l

This will show a listing of...
4,151
Posted By ohagar
Thanks all for the answers. I learned a lot more...
Thanks all for the answers. I learned a lot more about shell variables and sed.

Regards,

Ohagar
65,623
Posted By ohagar
The % is a wild card telling s ( the substitute...
The % is a wild card telling s ( the substitute command ) to apply the substitution to all lines of the file. If you only wanted to do certain lines the command would be something like:...
4,151
Posted By ohagar
ok so I made this _way_ to complicated.... I...
ok so I made this _way_ to complicated....

I first tried ( with no luck on lots of permutations ):
for i in `ls *bbb_*`
do
a=`echo $i | sed -e 's/\(*bbb_\)\(*\)/\10\2/g'`
mv $i $a
done

The...
65,623
Posted By ohagar
also works in vi vi <filename> then use the...
also works in vi
vi <filename>
then use the command
:%s/^M//g

to get a ^M use CTL-V then CTL-M

CTL-V tells vi to take the next command literally.
19,264
Posted By ohagar
check out useradd on your system. To find out...
check out useradd on your system. To find out about a command use the man command ( manual )
e.g.
man useradd
4,151
Posted By ohagar
renaming files
Hello all-

I need to rename files by adding an embedded 0
e.g.
aaa_bbb_1234 needs to become aaa_bbb_01234

The aaa and 1234 will change but the bbb_ can be my anchor.

TIA
Showing results 1 to 16 of 16

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