simple remove command -ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting simple remove command -ksh
# 1  
Old 12-14-2010
simple remove command -ksh

KSH

A simple remove command is not workin for me. The user has all the access and the return code after remove command is 0. But I am still able to find the file. I have the code as below.

Code:
tmplog=/tmp/$fl_nm.$$

main () {

--set of statments

rm -fr $tmplog
RC=$?

}

# 2  
Old 12-14-2010
Check if quoting the variable works..
Code:
rm -fr "${tmplog}"

# 3  
Old 12-14-2010
What Shell are you using?
What is the name of the file to be deleted ?
What is the value of the variable $fl_nm ?
Where in the script do you run the function "main" ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simple Variable substitution in ksh not working

Hi Gurus, Not able to catch what's going wrong here. I just want to get output as "tree". server:/mk/app/nexapp $ echo $SHELL /usr/bin/ksh server:/mk/app/nexapp $ export db_name1="tree" server:/mk/app/nexapp $ export i=1 1st try: server:/mk/app/nexapp $ echo $(db_name$i) ksh: db_name1: ... (3 Replies)
Discussion started by: mukesh.lalwani
3 Replies

2. Windows & DOS: Issues & Discussions

Super Simple Script to remove first characters of any png file

Well I searched the net with varying success, but it seems kinda hard to find a one/max 2 lined command to: strip all *.png files in the folder from their first two characters. Any help is appreciated. In DOS commandline of course... (17 Replies)
Discussion started by: pasc
17 Replies

3. Shell Programming and Scripting

how to execute ksh simple shell script without creating .sh file

please help me to execute a simple shell script like for i in `ls echo $i done . i dont want to create a new sh file to execute it. Can i just type and execute it ? because I always this kind of simple for loops . Please help . Thanks (7 Replies)
Discussion started by: Sooraj_Linux
7 Replies

4. UNIX for Dummies Questions & Answers

simple way to read an array in ksh

hi, I'm a newbie to shell scripting. I wanted to initialise an array using basic for loop and read it. Then i want to print it as a .CSV file.. Any help would me much appreciated.. (1 Reply)
Discussion started by: pravsripad
1 Replies

5. Shell Programming and Scripting

sh, ksh: command to remove front spaces from a string?

dear pro-coders, is there any command out there that takes out the front spaces from a string? sample strings: 4 members 5 members 3 members but it has to be like so: 4 members 5 members 3 members (3 Replies)
Discussion started by: pseudocoder
3 Replies

6. UNIX for Dummies Questions & Answers

Simple Array in Ksh Scripting

Ksh Scripting Can some one give me a simple example of array operations using ksh. For Ex: week_array = {Sunday Monday Tuesday Wednesday Thursday Friday Saturday} I want to assign and retrieve and print them along with their index. I am looking for the o/p like: 0 Sunday 1 Monday ... (2 Replies)
Discussion started by: ravikirankethe
2 Replies

7. Shell Programming and Scripting

need help with simple awk/ksh script

I need help finding out why this script wont run. The chmod is okay, but i get an error saying that I need '&&' on line 5. (18 Replies)
Discussion started by: tefflox
18 Replies

8. Shell Programming and Scripting

How can remove -ksh.log

Hi I tried to remove the -ksh.log from my directory using rm -f -ksh.log but i cann't do it ,please help how can i do it and also would like to know when this file will be created. many thanks in advance... Regards, HAA (0 Replies)
Discussion started by: HAA
0 Replies

9. Shell Programming and Scripting

Simple ksh script problem

This is a search script that I have developed. It finds the records that I look for. However the only thing I want the program to do now is to display a message such as 'Not Found' to appear when a record is not found. So far when a search doesn't display a record, the screen is blank. ... (14 Replies)
Discussion started by: Warrior232
14 Replies

10. Shell Programming and Scripting

Simple ksh question

Hi, Simple question I am sure... I need to put yesterdays date in the name of a filename, ie assign yesterdays date to a variable and then I can use it where I want.. using the format yyyymmdd Any suggestions? (1 Reply)
Discussion started by: frustrated1
1 Replies
Login or Register to Ask a Question