05-22-2008
Quote:
var2=$(users | awk '{for(i=1; i<=NF; ++i) if(!a[$i]++) printf("%s ", $i)}')
Hi, Thank you, this works, is it possible to it without using sed or awk.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
In my /etc/profile, my $PATH variable is set as follows:
$PATH =/sbin:/usr/sbin:/usr/bin:/etc
Then how do I add an additional directory to it? say
/export/home/abd/rose
Please advise.
Thanks!
Deepali (3 Replies)
Discussion started by: Deepali
3 Replies
2. IP Networking
hello,
I have to communicate with a distant station . But Both belong to the same area. So I do not need a gate .
But when I make a traceroute, it indicates that I pass through out a gate.
What can I do to establish a direct connexion between the both.
(with NT ) (1 Reply)
Discussion started by: hoang
1 Replies
3. Shell Programming and Scripting
Hello,
I have installed a new program called chimera under the directory /usr/local/bin/chimera.
the executable is under the directory /usr/local/bin/chimera/bin/chimera.e
If i put myself under the latest directiry and I type ./chimera, the program works.
I would like to avoid this and I... (1 Reply)
Discussion started by: nico-hellas
1 Replies
4. Shell Programming and Scripting
hi ,
I have a javascript file like this:
function fnValidateId(){
var array_id = new Array("444","7888","6633","555","146562","3333","33332")
var tmp_id = document.form1.id.value;
var num=0;
while(1)
{
if(tmp_id ==... (9 Replies)
Discussion started by: Sreejith_VK
9 Replies
5. Shell Programming and Scripting
Is there a command for finding all files on the system named ".bashrc" that modify the PS1 variable? I'd like to list the full file name(s) and the protection (including the full path). (5 Replies)
Discussion started by: raidkridley
5 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a file that looks something like this (2 columns 4 rows):
eeeeeeeeeeeeeeeeeeeeeeeeeeeee -45
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr -24
ttttttttttttttttttttttttttttttttttttttttttt -29
uuuuuuuuuuuuuuuuuuuuuuuuuuu -23
How do I get it to look like this:
-45... (3 Replies)
Discussion started by: phil_heath
3 Replies
7. Shell Programming and Scripting
Hello everyone,
I have some data files, with mixed header formats. the sample for the same is:
>ABCD76567.x1
AGTCGATCGTAGTCGTAGCTGT
>ABCD76567.y1
AGTCGATCGTAGTCGTAGCTGT
>ABCD76568.x1 pair_info:898989
AGTCGATCGTAGTCGTAGCTGT
>ABCD76568.y1 pair_info:893489
AGTCGATCGTAGTCGTAGCTGT... (2 Replies)
Discussion started by: ad23
2 Replies
8. Solaris
Hi,
I have a small piece of Makefile script which throw's error on Sun Sparc machine, but works fine with Sun Optron, Linux, AIX machines.
FOO=Naveen
test1:FOO=Dhilip
test1:
@echo FOO is ${FOO}
test2:
@echo Me is ${FOO}
Output on Sun Sparc -
ukhml-v890new-~/test: make test1... (5 Replies)
Discussion started by: nsriram
5 Replies
9. Shell Programming and Scripting
I have a script that currently runs fine and I need to add or || (or) condition to the if statement and I'm not sure the exact syntax as it relates to the use of brackets.
my current script starts like this:
errLog="/usr/local/website-logs/error.log"
apacheRestart="service httpd restart"... (3 Replies)
Discussion started by: jjj0923
3 Replies
10. Shell Programming and Scripting
Hello,
I have a filename that looks like this:
ABC_96_20141031_041133.232468
I need to shorten only the "_2014" part of the filename to simply "_14" so the filename looks like:
ABC_96_141031_041133.232468
I have to do a search for this string because there are hundreds of files and... (17 Replies)
Discussion started by: bbbngowc
17 Replies