LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-04-2004, 03:09 PM   #1
sceptreofjudah
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
bash shell script appends '?' to filenames


I have been attempting to run my old korn shell unix scripts on linux Redhat 9.0. I'm fairly new to linux but familiar with unix and am running into problems with it.

Right now, if i use a simple bash script in a file say: cat file.m4 > file.css

the resultant file name is: file.css?

If I just enter the above command from the shell it works fine, but if I put in a script file and run it, I get that darned '?' appended to the file name.

!!!!
 
Old 03-04-2004, 03:23 PM   #2
Falco
LQ Newbie
 
Registered: Feb 2004
Distribution: slackware,mandrake,suse
Posts: 9

Rep: Reputation: 0
I tried to do what you said, but it had gone right with my shell. (without the '?' appended to the "file.css")
maybe it's your bash environment which has some wrong settings.
 
Old 03-05-2004, 10:27 PM   #3
sceptreofjudah
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Original Poster
Rep: Reputation: 0
I must have have typo'ed a non-displaying control character in my script. I deleted the file and retyped from scratch and everything worked ok then!
 
Old 03-18-2004, 08:54 AM   #4
iluvunix22
LQ Newbie
 
Registered: Mar 2004
Location: North Carolina
Posts: 1

Rep: Reputation: 0
bash shell scripts

Hi, I am new to Linux and I have a question about a bash shell script. The script is to take one or more command line arguments and looks for those as files in subdirectories of the current directory. If the file is found in a subdirectory print a message that the file, print the name of the file is found exists in directory print the name of directory also. Otherwise file does not exist. Ignore all files, links in the current directory. After all subdirectories are searched print out a message that you are done processing the current directory( print its name).

What I have so far is
CheckforCmdInPath()
{
var=$1
if ["$var"!=""]; then
if ["${var%${var#?}}"="/"]; then
if [! -x $ var]; then
return 1
fi
elif !in_path_$var $PATH; then
return 2
fi
fi
}
if [$# -ne 1]; then
echo "Usage: $0 command"> & 2; exit 1
fi
CheckforCmdInPath "$1"
case $ 1 in
0) echo $1 found in PATH;;
1) echo $1 not found;;
2) echo $1 not found in PATH;;
esac
exit 0
What I have is not working. Any help is appreciated
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash shell script moodupani Linux - General 2 09-01-2005 06:14 AM
Bash Shell script bd1308 Linux - Hardware 9 08-22-2005 05:38 PM
bash shell script globeTrotter Linux - Newbie 5 06-03-2004 05:07 AM
bash/shell script mikis Programming 2 10-14-2003 11:39 AM
BASH shell script help ewarmour Programming 8 05-24-2002 07:57 AM


All times are GMT -5. The time now is 05:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration