Category: UNIX-Unix Beginner
select text within matching ( ) bracket
hi,
i am looking for a simple command to select text within a open bracket "("
and a matching close bracket ")" and output the within-bracket-text to a file.
this function is similar to the common vi select a range of text with "(" to ")"
but not sure how to run the same function in command line.
here's the input file :
statement statement statement
statement statement statement
statement statement statement
today( "here"
monday = map( "monday")
tuesday = map( "tuesday" )
wesnesday = map( "wednesday" )
thursday = map( "thursday" )
friday = map( "friday" )
saturday = map( "saturday" )
sunday = map( "sunday" )
);
statement statement statement
statement statement statement
statement statement statement
output file :
--------------
today( "here"
monday = layer( "monday" )
tuesday = layer( "tuesday" )
wesnesday = layer( "wednesday" )
thursday = layer( "thursday" )
friday = layer( "friday" )
saturday = pintext( "saturday" )
sunday = pintext( "sunday" )
);
thanks in advance,
Read More...
Category: UNIX-Unix Beginner
snmp
help - i need to get the snmp manager running on my aix box, os ver =
5.3 and i have to be able to use the command snmpwalk to get the data
from the devices i need to monitor. i cannot figure out what package
to install to be able to use that specific command, though i will
admit this is the first time i have ever tried to setup snmp.
can someone shed some light on this?
Read More...
Category: UNIX-Unix Beginner
how to transfer files from unix to my own hard drive storage?
i will leave the university i am working, but i need to backup and transfer my research data from unix system in our department to my own 750g hard drive storage. but i am not familiar with unix. how to do this? thank you.
Read More...
Category: UNIX-Unix Beginner
how to append a file extension to end of a file name??
hi,
i have a .txt file and it contains some file names.i want to append .gz extension to all the file names that are present within the .txt file.
input.
aa.bb.mar-20-2007
aa.cc.mar-20-2007
output
aa.bb.mar-20-2007.gz
aa.cc.mar-20-2007.gz
please help me with this command.
thanks,
Read More...
Category: UNIX-Unix Beginner
find, make and move file based on username
hi there,
i'm new to unix( just 3month used),
i found my new box contained alot of files and directories in /home/box/
i've tried to search script in tis forum and found many of them but, i don't know
how to combine them to make a script, although using pipes.
my tasks are:
1) to scan user dir in /home/user/ - i'm used ls-ld /home/$user/ , $user must be key in.
2) then, grouping all files in scanned dir(in task 1), into group of extensions such as ".txt",".sh",".dat"
i used the ls -l | awk 'begin {fs="."} {print $2}'>index.txt
3) based on index.txt, i'm going to make directories referring to those extensions eg.
/home/user/txtextension
/home/user/datextension/
then move all of files to their extension dir. i'm sorry, i can't find the way to create this script.
i tried all my best to combine all above simple script but, no.3 is quite hard for me.
is there any unix-shell expert have ideas, solutions, or even example scripts to guide me
regards,
Read More...
Category: UNIX-Unix Beginner
file permission
hi,
when i listed one directory in sun, it showed that :
-rwsr-xr-x 1 root bsmbin 78004 oct 21 2004 bsmprsm
i don't know meaning of the character "s" in "rws" above. i have searched in sun admin documents but no result. would you please explain it ?
Read More...
Category: UNIX-Unix Beginner
what editor does everyone use?
sory, i was looking through the topics and i wasn't sure if this was the best place to post this question:
i was wondering, out of curiosity, which software everyone was using to code their scripts in. i do mostly sh/ksh and my favorite has always been editplus because it is small, fast, yet powerful. plus other users in the community have coded syntax highlighting for languages that editplus hasn't included.
my two main concerns are:
1. simplicity (i tend to like souped up versions of notepad, which is what editplus seems to be).
2. syntax highlighting.
i posted this because perhaps there's an even better program i should be using. or perhaps someone has a very good syntax highlighting file that i haven't found yet.
Read More...
Category: UNIX-Unix Beginner
do i use grep for this?
say i have file1
1
1
1
3
4
5
and file2
1 hello i am 1
2 hello i am 2
3 hello i am 3
4 hello i am 4
5 hello i am 5
when i grep this i need this result
1 hello i am 1
1 hello i am 1
1 hello i am 1
3 hello i am 3
4 hello i am 4
Read More...
Category: UNIX-Unix Beginner
saving from unix into pc
hi,
i access unix through secure shell (ssh) from my pc running on windows. can i save files from unix directly into windows-run pc?. e.g. vi files into notepad???
thanks alot,
Read More...
Category: UNIX-Unix Beginner
how to obtain list of users ?
how to obtain list of users found in /home/ and append it to a file.
Read More...