Visit The New, Modern Unix Linux Community

Cd \bad-directory ; source junk.1 logs me off!

Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Cd \bad-directory ; source junk.1 logs me off!
# 1  
Cd \bad-directory ; source junk.1 logs me off!

Dear Gentle Folk,

I thought I knew unix/bash etc.

The compound statement


cd /lkjsdf ; source junk.1

completes and then logs me off IF the cd directory does not exist. It works fine if the
directory does exist. Why is this and how do I fix it.

It doesn't matter what is in junk.1, nothing will do.

cat junk.1
echo hello

cd /root ; source junk.1

cd \xoot; source junk.1
/xoot: no such file or directory
Connection to vm2 closed.

Thanks in advance
Homer W. Smith
# 2  

Moderator's Comments:
Mod Comment I saw from a quick Google search that this question is a cut and paste from another forum.

Please do not cut and paste formatted questions from one web forum to another.

This User Gave Thanks to Neo For This Post:

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #113
Difficulty: Easy
Linux is not Unix per se, but Linux is a Unix-like operating system.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

-bash: ./p4: /bin/ksh^M: bad interpreter: No such file or directory

I keep getting this error and I am not sure why. -bash: ./p4: /bin/ksh^M: bad interpreter: No such file or directory First I run my makefile and this works fine: goodmain: main.o gcc -o goodmain main.o main.o: main.c gcc -c main.c Then I want to limit my output so I... (11 Replies)
Discussion started by: cokedude
11 Replies

2. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies

3. UNIX for Dummies Questions & Answers

find command on a empty directory - bad status

when I run the following command in AIX (bash), find ./* I get the following error. find: bad status-- ./* Thats becasuse, its an empty directory. The same works, when there the directory is not empty. Even though the find deesnt have to rerun any result. My full find command would look... (4 Replies)
Discussion started by: deepakwins
4 Replies

4. Shell Programming and Scripting

Deleting 3 days old logs from a directory

As i am working in unix environment so i have an logs that is created by my application at the following location that is /opt/app/glac/current/servers/ops/logs inside the logs directory there are different kinds of logs(that is the file having extension as .log ) have been created... (1 Reply)
Discussion started by: 2015nks
1 Replies

5. Shell Programming and Scripting

Want to delete the junk files from a directory which are not listed in a TEXT file

Hello Everyone, I want to delete the image files from a directory, which are not listed in a TEXT file. The directory contains large number of image files (in millions) required / not required. I want to delete the image files which are "not required". I have generated a Text file having... (3 Replies)
Discussion started by: Praveen Pandit
3 Replies

6. AIX

Source IP not in my ftpd debug logs

I have random connections coming into my FTP server, but the source IP is not showing up in my logs. Here is what my logs look for me trying to connect as a "whatever" user that doesn't exist. You can see there is no source IP telling me where this connection came from: Jun 27 10:13:40... (4 Replies)
Discussion started by: kah00na
4 Replies

7. UNIX for Dummies Questions & Answers

Zipping the logs of directory

Hi Folks, I have logs at the following location cd /out/app/logs/ now that logs directory contain different types of logs now sometimes i need to do disk clean up activity so i need to zipped the logs can you please advise any command by which all the logs created in this directory are... (2 Replies)
Discussion started by: punpun66
2 Replies

8. UNIX for Dummies Questions & Answers

Source all files in a directory

Hi everyone, Is there an efficient way to source all of the files contained in a directory? Theoretically I could create a FOR loop and successively source each file, but I just wanted to check if there was a cleaner method. Thanks! Mike (3 Replies)
Discussion started by: msb65
3 Replies

9. Shell Programming and Scripting

Perl - bad interpreter: No such file or directory

Here is a puzzler. To start, let me say that I've done a search on this issue and it is definitely not related to line endings being encoded in windows returns. I get this error when I run SOME perl scripts. I have a script called I do $cp (0 Replies)
Discussion started by: mjmtaiwan
0 Replies

10. Shell Programming and Scripting

How to write logs to a specified Directory??

I have the following script which writes the output of the scirpt in a log file in the same directory from which the script is run. I need the scipt to write the logs daily to a differnt directory with the date appended to the log on a daily basis. The script is as follows... .... (1 Reply)
Discussion started by: nirmal84
1 Replies

Featured Tech Videos