Fills the variable PROCNAME with the basename (without path if existed), uses a dot as field seperator, and used the first part of the filename which was limited by dot/s.
Fills and exports the variabe LOG_DT with the value of date, though should have used %Y rather than 20%y
Similar as above but with time, and appending the .log extension to the string.
Fills and exports the variable FCTN_LIB with the (undefiend) variable ARCH_BIN_DIR, and appending the filename function_library.sh.
Sourcing the above defined file.
Finaly the LOG variable gets filled and exported by appending the above strings together.
Yet another PFILE variable, which is named the same as the script beeing executed, but having .ksh_param extension, rather than what was originaly.
Fill another variable with the basename without file extension to PGM.
Clear the screen, not that anything was printed yet...
Trying to trap a function, which was not defined in the given code, while passing 1 2 3 15.
There seems an error, as the first 1 is inside the quote to the function, which probably will cause the function to fail, since its quote, and since there is a space inside the quotes.
Filling variable A,B,C with the values of passed arguments 1,2,3 while cut off the 0 tailing chars.
Same as above, but cutting off 30 (D) or 270 (E) tailing chars (from the right!)
Fills the variable F with undefiend variable CDD as path and using PROCNAME (not PGM with the same content) and yet another file extension: .bad.
I had hoped to be specific with the areas that the requester was having problems with, but I believe that there is an error in your explanation for the variables A, B, C, D, E & F.
For A, B & C what you are actually doing (I will use example A) is assigning the variable A with the value of the first passed argument or if it is not set, assigning the variable to zero. So if you called the program with my_prog Hello World then A would become Hello, B would become World and C would be set to zero.
For D & E, the default values (if the 5th & 6th passed arguments are not set) are 30 & 270 respectively.
Variable F is an invalid statement, in that there is no closing double quote.
Additionally, the clear command not only clears the screen, but puts the cursor in the top left corner.
I agree Mr rbattle, things are temporary in this world. But dnt you think there are many people who are going to be benefited with this temporary solution too.
Not really. Nobody's going to need the exact same spaghetti code you used to shoehorn expect into this. expect is not a general solution.
Quote:
There are 1000's of post which have the same solution of using ssh key authentication.
And there will be thousands more until people realize "keys weren't just safer, they were simpler and easier in every way. I wasted so much time and thousands of lines of code wrangling expect instead of spending 5 minutes to set up proper keys and use the system the way it was designed."
• With this script, users will be able to
o Enter into the recycle bin mode. During this mode, all files deleted will be sent to the recycle bin. The recycle bin will be common to all users.
o View contents of the recycle bin (his/her file(s) only).
o Retrieve a particular file from the recycle... (3 Replies)
Hi ,
I am trying to unzip some file in a dir using shell script ,but it prompts for password to unzip those files ,how would i provide the passoword in the script it self (1 Reply)
Hello,
I have a requirement to shut down and start up my application on different environments (Dev, QA and Prod).
I have around 24 servers. I have to login to each server manually for shutinng down the application.
I wrote a shell command on each server and I am invoking those shell... (2 Replies)
I'm new into unix.
My question: is possible to write a shell script which will ask for the
ORACLE_HOME, ORACLE_SID, USERNAME, PASSWORD to connect to Oracle db.
In generally we have to set the ORACLE_HOME in .profile file. And after putting the 'sqlplus' command it asks for the username &... (6 Replies)
Hi All,
I am using Ubuntu machine with JDK 6. I am running following command on shell-
sudo ./somecript
. Now, it prompts for sudo password and I provide the sudo password on shell and "somescript" starts running with sudo permissions.
What I want to do is, I need to execute... (1 Reply)
Hello,
Can you help me to write a shell script for rsync a folder from my server to remote server ?
i do this in ssh by this command :
rsync -avz -e ssh /copy/me/ login@serverip:/where/to
i want have a shell script that do this command.
and you know that this command ask remote... (0 Replies)
Hello,
I wish to store the password in an rsync script so that when prompted it just enters the password.
I know I can set up passwordless logins, but I have never been able to do this on this particular server so I am resorting to storing the password in the script:
rsync -avz -e ssh... (4 Replies)
Hello,
I need assistance with creating a shell script to generate SSL Certificate Requests on remote hosts. Below is my stab at this, but I cannot figure out how to pass the requested arguments into the openssl command correctly. I have a major problem with redirecting the "answers" into the... (2 Replies)
Hi Friends.
I am new to scripting now i want to change the root password using the script with standard password.
which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Hi all,
passwd <username> < /var/adm/passwd.txt
cat /var/adm/passwd.txt
abcd1234
abcd1234
when I run this from the script, it comes with:
New password:
It is not able to pick from the location /var/adm/passwd.txt.
thanks in advance. (6 Replies)