Unix scripting problems


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix scripting problems
# 8  
Old 10-04-2010
On the surface the value in "$pwd" is not the correct password for the account "admin" on the remote server.
# 9  
Old 01-03-2011
Need Logic

Hi, i have a file called sc.txt
Code:
cat sc.txt
ecf0183.sh
ecf1002.sh
ecf1011.sh
ecf1020.sh

another file callled All.csv
Code:
Type,S Name,Mem Lib,S Id,S Table,App,Group
Reg sch,ecf1002,Link from 1,pcor1,EER,ecf1002.sh,ECF-D-LND-AMZ-A
Reg sch,ecf1002a,Link from 2,pcor1,EER,ecf1002.sh,ECF-D-LND-AX-B
Reg sch,ecf1011ab,Link from 4,pcor1,EER,ecf1011.sh,EW-G-LND-AX-C
Reg sch,ecf1020rt,Link from 9,pcor1,EER,ecf1020.sh,EW-G-JYD-GEX-D

i need to take the sc.txt as a reference and need to compare with All.csv and then need to create a file as below. please help me with the code
Code:
sc              S Name    S id    Group
ecf0183.sh  NA           NA     NA
ecf1002.sh  ecf1002    pcor1 ECF-D-LND-AMZ-A
                 ecf1002a  pcor1 ECF-D-LND-AX-B
ecf1011.sh  ecf1011ab pcor1 EW-G-LND-AX-C
ecf1020.sh  ecf1020rt  pcor1 EW-G-JYD-GEX-D


Moderator's Comments:
Mod Comment Please use code tags when posting data and code samples!

Last edited by Franklin52; 01-03-2011 at 04:31 AM..
# 10  
Old 01-03-2011
try this code, this will definetely help you..
Code:
ftp -n $server > $logfile <<EOF
 user $id $pwd
 put $fil1 $fil2
 bye
END

please let me know if you get any error.

Regards
rajesh


Moderator's Comments:
Mod Comment Please use code tags when posting data and code samples!

Last edited by Franklin52; 01-03-2011 at 04:31 AM..
# 11  
Old 01-03-2011
Although the here-document tags must match.
Code:
ftp -n $server > $logfile <<EOF
...
EOF

# 12  
Old 05-16-2011
question on sed command

Could someone explain what below sed command will do?
Code:
sed 's/'"$(echo '\011')"'//g'  file


Last edited by Franklin52; 05-17-2011 at 03:35 AM.. Reason: Please use code tags
# 13  
Old 05-16-2011
Code:
sed 's/'"$(echo '\011')"'//g'  file

the expectation could have been capturing the echo command's output as pattern for sed command, in this case it print \011.

I have no idea why this can't directly be used in sed. A good example would be putting pwd command instead of an echo.
# 14  
Old 05-16-2011
sed command

Can someone plase explain below sed commands too ?
Code:
sed -e 's/^ *//' -e 's/ *$//'
sed "$file1!d;q"<file2
sed 's/'"$(echo '\011')"'//g' file


Last edited by Franklin52; 05-17-2011 at 03:35 AM.. Reason: Please use code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Having issues finishing up a few scripting problems. A little help would be awesome

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: 4. Recall that the env command provides a list of various environment variables available to you. Two of those... (5 Replies)
Discussion started by: megachuk
5 Replies

2. Shell Programming and Scripting

100 interesting shell scripting problems

Hi all, I'm just learning to write shell scripts (new to the whole UNIX thing) and I'm wondering if anyone would like to help me create a resource to help me, and others like me, learn scripting. It would be something like "100 interesting shell scripting problems". All I need are... (7 Replies)
Discussion started by: nickednamed
7 Replies

3. UNIX for Dummies Questions & Answers

Code commenting Problems in shell scripting

Hi Friends, I Want to comment one line of code from below code. DBA_ORACLE_USER=`DB.sh -u -a User` DBA_ORACLE_PWORD=`DB.sh -p -a User` sqlplus /nolog <<-END > ${logfile} 2>&1 WHENEVER OSERROR EXIT 9 WHENEVER SQLERROR EXIT SQL.SQLCODE connect... (3 Replies)
Discussion started by: as234301
3 Replies

4. Shell Programming and Scripting

Execution problems with scripting

Hi, I am new to scripting.I had one problem infront of me.I tried in many ways with minimal knowledge........Kindly help me. Description: I want a shell script where it has to read an input.txt file and need to remove duplicate lines and the result need to kept in output.txt file. input... (5 Replies)
Discussion started by: bhas
5 Replies

5. Linux

ssh and passwd scripting execution problems on linux

I'm having a problem here and I was wondering if anyone could help me? I'm putting together a password script. First off, I don't have root access. I have sudo access. Lets say the User ID is Trevor1, the password is H!rry23! and the server name is Linux1234 This is how the script begins ... (5 Replies)
Discussion started by: wdog17
5 Replies

6. Shell Programming and Scripting

Execution problems with grep command in scripting

Hi All, I was looking for grep command option which can exactly matches the word in a file, for examples you may be seeing one word that is also in another word, there might be lkk0lv23 and a lkk0lv234 in which case lkk0lv23 will put BOTH hosts from the grep in. I was using this in a bash... (2 Replies)
Discussion started by: bobby320
2 Replies

7. Shell Programming and Scripting

Beginner bash scripting - a few problems

Hey Guys, I am creating a bash script on my freeBSD box, the script should basically ask the user to enter a username and domain. The script will take this information and basically append alot of information to config files so the user can receive email from that domain and create a web site at... (1 Reply)
Discussion started by: traxy
1 Replies

8. Shell Programming and Scripting

shell scripting on unix/mysql problems

Hi, I have written a shell script for oracle on unix that does a df for specific files, and then will display the size, Avail, % used and the difference from yesterday to today. I have been asked to place it on some MySql databases that run onn unix and linux also, but when I try to run them I... (2 Replies)
Discussion started by: cat55
2 Replies

9. Shell Programming and Scripting

Scripting problems

Hello, Im trying to write a script where it will only execute on a certain day. What would the script look like? if then do this is this correct?? (13 Replies)
Discussion started by: lewisoco
13 Replies

10. Shell Programming and Scripting

Scripting file permission problems...

Hello all - I have two systems. 1) Linux box running Redhat 8.0 2) Tru64 box running V4.0f From the Linux box I am remotely mounting a directory (nfs mount) that resides on the Tru64 machine. The directory that is nfs mounted contains two subdirectories: my_dir1 my_dir2 I want... (3 Replies)
Discussion started by: Heron
3 Replies
Login or Register to Ask a Question