Search Results

Search: Posts Made By: uativan
4,432
Posted By uativan
Any guys here could help for my problem? thanks...
Any guys here could help for my problem?
thanks a lot.
4,432
Posted By uativan
Thank you for your reply I tried your method...
Thank you for your reply
I tried your method but the output is my whole code.

su user << EOF
some commands
result=$?
echo $result
EOF

I tried another one


RETURN_VAL=$(su user <<...
4,432
Posted By uativan
Get execute result of su
I wrote a shell script.


su user << EOF
some commands
result=$?
EOF

echo $result
Other program determined by $result



It outputs nothing.

How to pass the variable 'result'...
3,907
Posted By uativan
I use GNOME, not VNC. I want to know the same...
I use GNOME, not VNC.
I want to know the same command as the menu button "System > Log Out root".

Thanks!
3,907
Posted By uativan
command to exit xwindow
What is the command to exit xwindow when i am in xwindow's terminal.

Thanks in advance.
6,500
Posted By uativan
Thanks your reply. I tried two different...
Thanks your reply.

I tried two different code to put my script in /etc/rc.local

Here is my /etc/rc.local

#!/bin/sh

touch /var/locak/subsys/local

/bin/sh /folder/script.sh


or...
6,500
Posted By uativan
Scripts after startx
I want to autorun a shell script which
inculde start two java programs and some shell scripts

I using fedora 9 and I had put in Personal > Sessions
/bin/sh /myscript.sh

but it got a problem...
1,550
Posted By uativan
Thanks for your reply. I have to setup...
Thanks for your reply.

I have to setup configuration for another computer so that the rsync works.

Just like doing the configuration for twice.
1,550
Posted By uativan
rsync from client
I have two computers, one client and one server.

On server side, I can use the following command to synchronize files.

rsync -rvlHpogDtS -password-file=/root/rsyncd.secrets /my_folder/...
4,337
Posted By uativan
<<white space>>name ----------- <<white...
<<white space>>name
-----------
<<white space>>Mary Lee
(1 row)



for n in $name
do
echo $n
done



0000000 n a m e \n - - - - -...
4,337
Posted By uativan
Really sorry about the misleading. Since I am not...
Really sorry about the misleading. Since I am not familiar with shell script, I can just tell you what I can see from the screen.

1. Single line
before asking

name=$(pgsql -c "select name from...
4,337
Posted By uativan
I follow your suggestion name=$(pgsql -c...
I follow your suggestion

name=$(pgsql -c "select name from teacher")
name=${name% (*}
echo "${name#*- }"

I got
"name"
"------------"
" Mary Lee "
"(1 row)"

Any ideas? Thanks again!!
4,337
Posted By uativan
The result from the sql now is a little bit...
The result from the sql now is a little bit different,

"name ------------ Peter (1 row)"
"name ------------ Mary Lee (1 row)"

The result is vary in word length.

set -f
set -- $name...
27,438
Posted By uativan
No need to "Sorry" la, you really really help me...
No need to "Sorry" la, you really really help me a lot.
Really appriciate your help. :b:
27,438
Posted By uativan
I used IFS=' ' list=( $(ncftpls .....)...
I used

IFS='
'
list=( $(ncftpls .....) )
array=( printf "%s/\n" "${list[@]}" )


The array become
"printf"
"%s/\n"
"drwxr-xr-x ...."
"drwxr-xr-x ...."
...
27,438
Posted By uativan
Sorry for so many questions. Thanks first. I...
Sorry for so many questions. Thanks first.
I want to add a "/" next to each item in array, is the following method the fastest?

for a in ${list[@]}
do
array=("${array[@]}" $a"/")
done
27,438
Posted By uativan
list=$(ncftpls -u user -p pass -t 2 -x -l...
list=$(ncftpls -u user -p pass -t 2 -x -l ftp://ip/)
echo $list output is
drwxr-xr-x 2 0 0 4096 Dec 19 10:27 FolderName1 drwxr-xr-x 2 0 0 4096 Dec 19 10:27 FolderName2 drwxr-xr-x 2 0 0 4096 Dec 19...
27,438
Posted By uativan
Thanks a lot. I changed to use list=$(ncftpls...
Thanks a lot.
I changed to use
list=$(ncftpls -u user -p pass -t 2 -x -l ftp://ip/)
echo "$list"

It works great.

Further question is how to split the lines into an array?
27,438
Posted By uativan
Thank you for your suggestion. I replaced...
Thank you for your suggestion.

I replaced the "ftp -n -i -v ip" code to "ncftp -u user -p pass ip"
I want to list out the files of the folder from remote ftp
Before I use "ls . folders" to save...
27,438
Posted By uativan
Thanks for your advice. The ip address could...
Thanks for your advice.

The ip address could be pinged but the computer do not have open ftp / firewall any reason that can't connect through ftp and it hang for a very long while.

Any other...
27,438
Posted By uativan
how to set timeout?
When I run a script where the 1st parameter is ip address
ftp -n -i -v $1

I hang here if the ip is wrong
how to set a timeout something like

if (20s not complete "ftp -n -i -v $1") then
...
4,694
Posted By uativan
Both of you thanks a lot!!.
Both of you thanks a lot!!.
4,694
Posted By uativan
Check Error On Script
If I have a script createdb.sh
...
psql -U postgres -c "create database dbname"
...

I want to write something like
if IsErr(psql -U postgres -c "create database dbname")
ehco "OK"
else
...
4,337
Posted By uativan
set -f set -- $name echo $3 I used the...
set -f
set -- $name
echo $3

I used the code and it work fine, thank you very much!!:b:
4,337
Posted By uativan
thanks for your reply I stored the result...
thanks for your reply

I stored the result in a variable

name=$(pgsql -c "select name from teacher")

$name is a single line
and equal to "name ------------ myname (1 row)"
I want to get...
Showing results 1 to 25 of 34

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