Search this Website

 

Ubuntu

UNIX

saving from unix into pc

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...

user permission

Category: UNIX-Unix Beginner

user permission

hi all,

i created testuser. by following command.

code:
/usr/sbin/adduser -n test -d /disk05/collections/get/testdata/
and then set its password by following command.

code:
passwd testuser

when i login to system by testuser, it enters everything is ok.
the problem is how to set permission to this user not do anything out of its home directory. it is /disk05/collections/get/testdata/
how can i do this permission?


Read More...

inappropriate ioctl for device at

Category: UNIX-Unix Beginner


Read More...

how to get rid of ^m from sql query

Category: UNIX-Unix Beginner

how to get rid of "^m" from sql query

i've searched the net and tried various solutions that don't work for me.

i'm trying to return values from a sql query and i keep getting a "^m" appended to one field.

code:

getting data from table

select * from table...
spooling to $home/out.log
...

wf_data=`tail -7 $home/out.log | awk '{print $1}'` assigning the values to wf_data variable

echo $wf_data > $home/out.log returning the data to out.log ... (may be dumb way but it works.. i need it for formatting purposes

wf=`tail -1 $home/out.log | awk '{print $1}'` #getting workflow
f=`tail -1 $home/out.log | awk '{print $2}'` #getting folder
s=`tail -1 $home/out.log | awk '{print $3}'` #getting server
u=`tail -1 $home/out.log | awk '{print $4}'` #getting user
p=`tail -1 $home/out.log | awk '{print $5}'` #getting pass

variable wf is having the "^m" appended to it.

any suggestions as to how to remove it?

(i tried sed -i '' "s/\r//g" $home/out.log (along with other variations) right after the sql statements and other sections - didn't work)


Read More...

triml leading zeros in unix

Category: UNIX-Unix Beginner

triml leading zeros in unix

hi all,

how does one trim leading zero's in unix

thanks


Read More...

do i use grep for this

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...

running unix commands remotely in windows box from unix box

Category: UNIX-Unix Beginner

running unix commands remotely in windows box from unix box ?avoid entering password

i am able to run the unix commands in a windows box from a unix box through "ssh" functionality. but whenever the ssh connection is established between unix and windows, password for windows box is being asked.

is there a way to avoid asking password whenever the ssh connection is made? can i store required passwords in a file and then use that file for password prompt whenever ssh is established?


Read More...

explanation of error message(s)

Category: UNIX-Unix Beginner

explanation of error message(s)

i am completely new to unix, have ordered the books recommended in this forum, however where would i find an explanation of error messages, the one
that i'm looking at states +kern.maxfiles limit exceeded by uid 1002, please see tuning(7). all i know is that we have the latest bsd version.


Read More...

scheduling tasks with cron

Category: UNIX-Unix Beginner

scheduling tasks with cron

hello there,

i'm learning about task scheduling with cron and all seems hyper exciting, yeppie. but there is a prob:

assume i have a script that needed to be executed at 7am everyday. i could do:

vi mycron
00 7 * * * echo hi mother, i wanna be a script daddy.
:wq

crontab mycron

how can i have the shell send the results to my neighbor's email address at

unixbuddy@hello.com?.

i added mailto: unixbuddy@hello.com in my script but didnt work.

thanks all very much,


Read More...

list services running in unix

Category: UNIX-Unix Beginner

list services running in unix

we have lost our sys admin and with the dst changes.. i need to make sure all services are re-started on a sun server running sunos 5.9

how can i list what is running and make sure they are running after the dst patches are applied?


Read More...