Search Results

Search: Posts Made By: phudgens
3,168
Posted By phudgens
Clearing leading and trailing blanks from a string in C Shell
Does anyone know of a way with C Shell that will work on both Linux and Sun to clear all leading and trailing blanks from a previously specified string? I am using the following code to replace...
2,283
Posted By phudgens
Exit status for ftp in CShell
Is there a way in the following CShell code to have ftp give an exit status that can be retrieved to determine if it succeeded or failed?


ftp -n logxx.xxxx.xxx.xxx.com <<DO_FTP1
quote user...
12,163
Posted By phudgens
Is there not a way to have ftp give an exit...
Is there not a way to have ftp give an exit status that can be retrieved to determine if it succeeded or failed?

Thanks,
Paul H.
12,163
Posted By phudgens
Retry upon FTP failure
How does job.complete get on the remote server from which you are trying to retrieve it in the first place?

Thanks,
Paul H.
12,163
Posted By phudgens
Sorry - that didn't work. The script stalls at...
Sorry - that didn't work. The script stalls at the re-direction and just sits there. I have to ctrl-c to end it. Thanks anyway.
12,163
Posted By phudgens
Retry upon FTP failure
I am using the following code in a C Shell script to transfer files to a remote server:

ftp -n logxx.xxxx.xxx.xxx.com <<DO_FTP1
quote user $user_name
quote pass $password
ascii
put...
23,168
Posted By phudgens
Check for file existence using wildcards
Thanks for the reply. This is not the first time that someone has suggested that I not use C Shell coding for my scripts. The problem is that all of my users log in to, and launch their programs...
2,440
Posted By phudgens
Extracting first character from a user response
This works - thanks for the help.

I had tried exactly what you show, only I re-used main_answer instead of a new variable (in this case short_answer). Apparently that doesn't work in CShell like...
2,440
Posted By phudgens
Extracting first character from a user response
Scott,
The:
echo $main_answer | cut -c1 | tr '[a-z]' '[A-Z]'
code works on both Unix and Linux, but I'm having difficulty capturing that first character of the user response in a variable that can...
23,168
Posted By phudgens
Check for file existence using wildcards
Azhrei's use of the /dev/null method reminded me that I had used this code previously. I was able to find it in some old code and got the following to work in both Unix and Linux. Thanks everyone for...
2,440
Posted By phudgens
Extracting first character from a user response
I am using the following code in a CShell script to get a yes/no response from the user:

echo ""
echo -n "Do you want to archive your main level directory? <y> or n: "
set main_answer = $<

...
23,168
Posted By phudgens
Check for file existence using wildcards
I am using the following command to check for files on a Unix (Solaris 9) and on Linux:

if (-r *.[Ll][Aa][Ss]) then
echo " las file found"
else
echo " no las file found"
endif

If no...
3,233
Posted By phudgens
Restricting zip to current directory only
Sorry about my delay in replying - I'm finally getting time to get back to this. I have tried both procedures suggested, but neither worked on either UNIX or LINUX. I was getting "ProjectZipFile:...
3,233
Posted By phudgens
Sorry about my delay in replying - I'm finally...
Sorry about my delay in replying - I'm finally getting time to get back to this. I have tried both procedures suggested, but neither worked on either UNIX or LINUX. I was getting "ProjectZipFile:...
3,233
Posted By phudgens
Restricting zip to current directory only
I am using the following command in a C shell script:

find . -name "*.*" -print | zip $ProjectZipFile -@

to zip files in a Unix (Sun and/or Linux) directory for archiving purposes. This...
3,675
Posted By phudgens
I am using -v, and the files are echoed to the...
I am using -v, and the files are echoed to the screen - the problem is that they are extremely large files and the screen can be motionless for hours while the file is zipped/tarred/ftpd. Are there...
3,675
Posted By phudgens
Hash marks when running tar or zip from Cshell
Does anyone know how to get hash marks (or some other visual indicator) to print to the screen during tar or zip commands run from within a Cshell on Sun or Linux? Currently the user receives no...
8,432
Posted By phudgens
The following command: nawk -F \"...
The following command:

nawk -F \" '/COMPANY/{getline;getline;print $2}' asciipds | head -1

returned the following string:

BATTELLE MEMORIAL INSTITUTE

Without the "head -1" it was...
8,432
Posted By phudgens
When I run the following command from the command...
When I run the following command from the command line prompt:

awk -F "\"" '/COMPANY/{getline;getline;print $2}' asciipds

I get:
Unmatched "

When I run:

awk -F \"...
8,432
Posted By phudgens
I have just discovered that by piping the...
I have just discovered that by piping the results of the sed command to head -1 returns the desired string, (and only the desired string). ie:

sed -n '/WELL:/{n;n;p;}' asciipds | awk -F\" '{...
8,432
Posted By phudgens
Despite trying various modifications of the awk...
Despite trying various modifications of the awk command I was not able to get it to work.

The sed command came very close though. It returned the desired string, but also a second undesired...
8,432
Posted By phudgens
Advanced sed and awk
Despite trying various modifications of the awk command I was not able to get it to work.
The sed command came very close though. It returned the desired string, but also a second undesired line....
8,432
Posted By phudgens
The actual file is immense, so I'll just add a...
The actual file is immense, so I'll just add a few lines of particular interest to me. There is a problem reading other lines where the number of parameters varies as in the following:

TextRel...
8,432
Posted By phudgens
That works both at the prompt and from within the...
That works both at the prompt and from within the script. Thanks Loads,

Paul H.
8,432
Posted By phudgens
Using the following command at the command line...
Using the following command at the command line prompt:

nawk -v qq='"' 'c&&!--c {print substr($0, index($0,qq))};$NF ~ "WELL:" {c=2;next}' asciipds

I got the following message:

123: Event...
Showing results 1 to 25 of 46

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