Help with opening another file from within a shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with opening another file from within a shell script
# 1  
Old 08-03-2010
Help with opening another file from within a shell script

Hi,

I am trying to open a file that I have created from withn a shell script and cannot seem to get it working. Does anyone have any ideas?

Thanks.
# 2  
Old 08-03-2010
Do u have a specific code that is not working? Or in general if u want some sample code on how to open files from shell scripts then please

Code:
#!/bin/ksh
for values in `cat a.txt`
do
echo ${values}
done

# 3  
Old 08-03-2010
Hi,

I am trying to open a file name menu from the following shell script:

Code:
echo "Please enter your password"
#get password:
echo "Password: "
read password


#create for user name
name=$(grep $user ./test2 | cut -f1)
password=$(grep $password ./test2 | cut -f2)

if [ "$user" == "$name" ] && [ "$password" == "$password" ];
then

        echo "Hello $name welcome to this ATM"
else
        echo "Login Failed"

fi


Thanks.

Last edited by pludi; 08-03-2010 at 12:09 PM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Shell Scrip in Masking particular columns in .csv file or .txt file using shell script

Hello Unix Shell Script Experts, I have a script that would mask the columns in .csv file or .txt file. First the script will untar the .zip files from Archive folder and processes into work folder and finally pushes the masked .csv files into Feed folder. Two parameters are passed ... (5 Replies)
Discussion started by: Mahesh G
5 Replies

2. Shell Programming and Scripting

Opening a file in vi and automatically save and quit this file using shell script

Hi friends, In my shell script, I want to open a file using vi editor. After opening the file in vi, I want to save and quit this file automatically.... all through shell script. the code segment is: ------------------------------------------------------------ cd ~/netfpga/projects/scone/sw/... (2 Replies)
Discussion started by: sachinteotia
2 Replies

3. Shell Programming and Scripting

Help with Shell Script opening and closing a program

REALLY new to this stuff, sorry. So I want a shell script to open a program, wait 45 minutes, close it, and then do it all again. I want to do this because I am running an iMacros Script for a long period of time and if Firefox is not constantly restarted, memory leaks start to happen. Anyway... (6 Replies)
Discussion started by: plsbbg
6 Replies

4. Shell Programming and Scripting

Opening Child Shell & Executing a script in the same context

Hi, Is the below possible (SHELL = tcsh)? -- I want to write an 'alias' something like this - alias set_my_work "setenv SOME_VAR;tcsh -i;source work_script.cshrc" The intention is to run this alias and enter a child shell, at the same time ensuring that the work_script.cshrc is source-ed.... (0 Replies)
Discussion started by: mishra.a.c
0 Replies

5. Windows & DOS: Issues & Discussions

Error opening script file - location error

Hello, I know nothing about UNIX, ftp, etc. I am building an excel VBA macro which calls a .bat file. I've taken a pre-existing batch file and am trying to modify it to fit my purposes. I would be very grateful for some assistance. Here is my .bat file: echo off set... (9 Replies)
Discussion started by: starcraftbud
9 Replies

6. Shell Programming and Scripting

Run multiple commands in $() without opening a new shell

The code below works, but takes too many lines and looks awkward: db2 "export to $filename of del select * from $table with ur"|tee -a $LOGFILE|awk '/Number of rows exported:/ {print $5}' > numrows.tmp numrows=$(cat numrows.tmp) rm numrows.tmp When I try the... (2 Replies)
Discussion started by: akar_naveen
2 Replies

7. Shell Programming and Scripting

Opening a File with a script

Hi, i am writing a script for exporting tables in oracle, my requirement is to take parameters from the user in a file.. i have to open vi the file,, once user is done with entering the parameters i have to save the file and execite the command exp parfile=exp_2.par .. please let me... (1 Reply)
Discussion started by: saharookiedba
1 Replies

8. Shell Programming and Scripting

Getting Following problem when opening shell script (Very Urgent)

Hi All, Actually when i am trying to open my shell script file 1.sh then i am getting the following error. > vi 1.sh "/var/tmp/ExdNaarK" No space left on device Can anybody tell me that how to rectify it. It is very urgent. Because i am not able to do any work due to the above error. ... (1 Reply)
Discussion started by: sunitachoudhury
1 Replies

9. Shell Programming and Scripting

Opening a UNIX shell in Java

Hi, I need to simulate the machine's native shell (sh), for that I open up a UNIX shell in my Java program. My code works fine with windows shell ('cmd') but with unix ('sh') I failed to retrieve the machine's prompt. I believe that the issue is unix-related and that the process I launched has... (2 Replies)
Discussion started by: guyi
2 Replies

10. Shell Programming and Scripting

Urgent help required in deleting a line without opening a file usinga shell script

Hi, I need a help in deleting a line matching a particular pattern in a file using shell script without opening the file. The file is a .c/.cpp file. Is it possible? Thanks (6 Replies)
Discussion started by: naan
6 Replies
Login or Register to Ask a Question