This is a problem with basic Unix scripting. Thanks for looking!
1. The problem statement, all variables and given/known data: Make a script that will compare 2 given directories and output those filenames that are in Directory 1 and not 2
2. Relevant commands, code, scripts, algorithms:
Sed & Awk can't be used. The main problem with my code below is that the variable x, after being assigned the value 1 seemingly changes back 0 after leaving the if statement.
Directory 1 (d1) has the three files
A, B, C
Directory 2 (d2) has the three files
A, C, E
Therefore the following should be the output:
3. The attempts at a solution (include all code and scripts):
This is my script so far.
With the trace included above, I get
Without Trace:
Meaning after the x is changed to 10 when a match is found, its later turned back to 0 for a reason I cant explain
If anyone could help be out I'd really appreciate it.
Thanks in advance!
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
University of Toronto, Toronto, Canada, Prof. Michaels
Hi I am new to scripting and have a function in my .sh script file that outputs a html radio button form
weather_forecast_config()
{
echo ""
echo "<html><head><title>Welcome</title></head>"
echo "<body>"
echo "<h2>Weather Forecast - Change City</h2>"
echo "<form name="input"... (5 Replies)
Dear all,
I have kind of used both the awk/sed command and found them really useful.
But at the necessity I am having right now, I need help.
Actually, I would like to do the following in file script.sh
PATH535="/eos/uscms/store/user/pooja04//analysis2012/535/mc/summer12/002/tt/"
... (2 Replies)
All,
I am pretty new to Unix and still in the learning curve :) I have a simple requirement for which I did not get an answer yet (Atleast I do not know how to keyword the search for my requirement!!!).
I have an executable script my.script1 in a folder /data/misc/scripts/dev, which when... (5 Replies)
I have a variable:
$FILENAME = /XXXX/XXXX/XXXX/file.dat
I want to set another variable that will give me this:
$FILENAME2=filea.dat
So basically i'm chopping up variable $FILENAME.
Not sure cut will do this as i'm looking at different directories so the characther length may be... (2 Replies)
I have a continous polling happening inside a shell script on AIX. This actually calls a PL/SQL block. Is there a way I can set up a variable or pass an interrupt to end the script gracefully. I cant read from the config once the job starts running. Ideally I should change value of a variable and... (1 Reply)
Hi all, im new to awk and would apreciate if you could tell me how to do this, i have a file with several entries like this:
2008-09-09 21:57:45 44 403 CUSTOM_EVENT Upgrade - end1
2008-09-09 21:57:46 45 403 CUSTOM_EVENT Component Check - start... (3 Replies)
Hi to all in forum and I hope someone will be able to help.
It is likely that over the next couple of months I have to get a hands on knowledge of Unix due to incoming work in company and I hope to be able to get some knowledge from the general Unix community.
In the meantime I have one... (2 Replies)
I'm currently working on my second ever ksh script!
So I apologize if this is a stupid question - I've searched the forum and on google and haven't seen anything :confused:
I'm running my script with an input at startup
that variable determines a couple of other values(int) that I store into... (1 Reply)
Hi sir,
i need help in scripting..
i have 30 users like below
eda01
eda02
eda03
eda04
.....
......
eda30
I want to reset all users password start with eda01 until eda30 to default password 1234
how do i do this using script,
i dunt want system prompt me for password..
i am... (5 Replies)
Hello there !
I am new in this Unix world and just start learning Unix. I have very simple question about changing PS1 variable (Shell Prompt)
i have local.profile file in my working directory, i open in vi edit mode and add this line PS1="Hello:>" and i save that file.
I disconnected from... (2 Replies)