Search Results

Search: Posts Made By: tpltp
3,379
Posted By tpltp
Thanks for your reply, drl. I am using csh,...
Thanks for your reply, drl.

I am using csh, not tcsh.
'which' will have different behavior on different machines.
I tried on AIX5300, before it gave out the "ls" path, it will first source...
3,379
Posted By tpltp
which CMD in csh
Today I encounter one problem, I ran one script like follows:

#!/bin/csh -f

which ls

It supposes to skip the .cshrc and .login files when run this script with the "-f" option, but it does...
2,130
Posted By tpltp
I just realized that this is not a problem about...
I just realized that this is not a problem about array, it is problem just like follows:
set CMD = "ls -ltr|wc -l"
`$CMD` or $CMD are all wrong, can any one give me a solution if I want to use the...
2,130
Posted By tpltp
I mean how I can use the commands list in an...
I mean how I can use the commands list in an array, or even aliases I created...
2,130
Posted By tpltp
Array problems in CSH
Hi all,

I want to use some commands and I wrap them into an array, like follows:
set ALIAS_AR = ( "ls -ltr|wc -l" \
"ps -ef|grep -v grep |grep tty|wc -l" \
...
4,085
Posted By tpltp
Variables in HERE DOCUMENT
Here is my problem: can we set the variables in the HERE DOCUMENT? I have tried but failed. Any one has good comments please let me know.

#!/bin/csh -f

pbrun -u xmgbrk runshell <<!
@ $num1 =...
3,574
Posted By tpltp
Yes, reborg. As I reset the env variables for...
Yes, reborg. As I reset the env variables for http_proxy and ftp_proxy, they are fine now.

BTW: I used the uppercase HTTP/FTP_PROXY for the env variables, and they are incorrect.

Thank you very...
3,574
Posted By tpltp
Use putty problems in windows
Hello all,

I have encountered a strange question. I installed a Ubuntu 8.10 in the VMware in the XP, and use putty to connect to ubuntu. Everything is fun except I can't use the wget in putty,...
13,406
Posted By tpltp
alias in CSH
Hello guys,

I want to use an alias as an sub function in the script. Here is my issue:
I want to use
exsit_en <pattern> <file>
to indicate that if the <file> contains <pattern> the expression...
2,079
Posted By tpltp
${name${i}} problem in CSH
Hello all,

I tried the following commands in the cshell, but failed.
~Cshell %set i=2
~Cshell %set fields${i}= ( ad dd dd )
~Cshell %echo $fields${i}
fields: Undefined variable.
~Cshell %echo...
9,566
Posted By tpltp
As I tried many times, and now I have a fix: Do...
As I tried many times, and now I have a fix: Do NOT use the double quotes around the awk command in echo
echo "Your login name is $logname, your user's ID is " `grep $logname /etc/passwd|awk -F:...
1,717
Posted By tpltp
Hello Palsevlohit, How to deal this with sed...
Hello Palsevlohit,

How to deal this with sed command?
When I try this, i got the following error:
echo "('20080920212141','net','Q05','DB','0','20080921064023','netbackup','netbackup')" |sed -e...
9,566
Posted By tpltp
AWK in CSH script problems
Hello Guys,

I was trying to obtain the information from the /etc/passwd file, here was my script:
38 echo -n "What's your login name? "
39 set logname=$<
40 echo "Your login name is $logname,...
14,795
Posted By tpltp
Thank you, I missed the part after the option.
Thank you, I missed the part after the option.
14,795
Posted By tpltp
The sort option -K
Hello aigles,
Could you elaborate that the option of sort -k?
I mean in your two solutions, the first one used -k1.9 and the second one used the -k1,1, are there any difference between them? I...
Forum: Ubuntu 05-27-2008
1,990
Posted By tpltp
Help me: Problem to log into systems
Hello everyone,

I have problems to log into systems recently. Here is the description of the problem:
I installed windows and ubuntu linux in my laptop, sometimes after I pushed the power button,...
11,508
Posted By tpltp
You mean you execute the script, and you get two...
You mean you execute the script, and you get two variables? You can try this.

#!/bin/bash
#GetVarOnceALine.ksh <logfilename>

line=`head -1 $1`
if [ $line -eq "" ]; then
echo "Logfile is...
1,880
Posted By tpltp
It makes a bit more clear to me. Thank you for...
It makes a bit more clear to me. Thank you for your detailed explanation... I can seek for some real and good scripts, and study from the basic.

Thank you again...
1,880
Posted By tpltp
Thank you era, again!! It works now. The if...
Thank you era, again!! It works now.

The if can determine the exit status of the command, I forget this!!! And the powerful AWK...
But could you explain the exec command? It seems strange and...
1,880
Posted By tpltp
What's going on in my scripts?
In my script:

1 #!/bin/ksh
2 #To retrieve the ID for lots of the channels
3 #The id is the _NEWESTEID
4 #Usage: RetrieveID.ksh <filein> <fileout>
5 set -x
6...
Forum: Linux 04-04-2008
2,597
Posted By tpltp
Thank you very much, joeyg. Your way works!
Thank you very much, joeyg. Your way works!
Forum: Linux 04-03-2008
2,597
Posted By tpltp
How can I use "r" in the bash?
In the ksh, we can use r -[n] to repeat the command use before, but in the bash, it seems not. My question is, how can I use the "r" in the bash? Do i need to install sth? Thank you
13,247
Posted By tpltp
I have tried in the bash, and ls can use the...
I have tried in the bash, and ls can use the pattern[0-9] as a filter.

Are you sure there are files matched the pattern in the specified directory?
2,395
Posted By tpltp
Thanks again, era. You are a master in this...
Thanks again, era. You are a master in this field! Your suggestion makes my script much easier. Keep learning from you...
2,395
Posted By tpltp
Very strange things happened in the shell function
Here is the script:

#!/bin/bash
#set -xv
RAWDATAFILE="temp1"
GOODDATAFILE="temp2"
FindSOS()
{
local NUM=0 #return value for the id of SOS
local cnt=1
if grep "EOS" $1
then
sed -e...
Showing results 1 to 25 of 32

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