Dear all experts,
I have a script written to compress a list of files, during compressing, some of the files are having same name. When the compressing started, the same name file will be prompted with message whether to overwrite the old file. I need to enter "y" to continue.
Is there any way I can put into the script so that it will answer "y" for each of the prompted question?
In DOS, as I know can put a prompt off, but I do not know what should I put on Shell Script.
Thanks.
Dear sea,
I am not referring to tar command. I refer to compress command.
For example, I have a file name "aaaa" and I would like to compress it. I will run command "compress aaaa" and it will become aaaa.Z
After that I received another aaaa file again. This time when I perform compress aaaa, the system will prompt me a message as
Do you wish to write over the existing file aaaa.Z?
I have to enter "y" to overwrite the original file.
I would like to know how can I skip the answering "y" in my script so that the above prompt will not appear?
sea, what you quoted from is a Linux man page. This is the AIX board and the AIX tar works quite differently - POSIX-compatibly, that is.
Quote:
Originally Posted by kwliew999
For example, I have a file name "aaaa" and I would like to compress it. I will run command "compress aaaa" and it will become aaaa.Z
After that I received another aaaa file again. This time when I perform compress aaaa, the system will prompt me a message as
Do you wish to write over the existing file aaaa.Z?
I have to enter "y" to overwrite the original file.
I would like to know how can I skip the answering "y" in my script so that the above prompt will not appear?
Even if sea's suggestion was faulty his intention was right: read the man page (of compress, instead of GNU-tar) to find the following:
How to use man
As you mentioned DOS i suppose you are not familiar with UNIX in general or AIX in specific. Here is a general advice: if you do not know how to use/configure a command you can always enter
to get the "man[ual] page" of command. This works even for man itself, so man man will tell you how to use man. The works not only for commands but also standard configuration files. Enter, for instance,
to get information about the file /etc/filesystems, which denotes all the mountable filesystems in a system.
(Tip: the paginating program used in man is more which navigation keys match the ones of vi. Scroll down a line with "j", scroll up a line with "k", etc..)
If you are not sure which command to use you can search all the man pages for a specific term with the man -k keyword (or its more eponymic alias apropos keyword) command, which will list all the man pages containing keyword.
TQVM for the parameter "-f". I just keep on digging how to send in a "y" for whatever return on screen. Never in my mind tho of using compress function's parameter.
Thanks.
---------- Post updated at 05:34 PM ---------- Previous update was at 05:29 PM ----------
Dear Bakunin,
Thanks for your detail and helpful hint.
I do know how to use AIX's man. I not familiar with Linux tar. Now only I know tar is something like man in unix.
I was digging the way how to pass a "y" into anything pop up on screen. Never tho of checking function compress's ability.
Anyway, thanks a lot.
Quote:
Originally Posted by bakunin
sea, what you quoted from is a Linux man page. This is the AIX board and the AIX tar works quite differently - POSIX-compatibly, that is.
Even if sea's suggestion was faulty his intention was right: read the man page (of compress, instead of GNU-tar) to find the following:
How to use man
As you mentioned DOS i suppose you are not familiar with UNIX in general or AIX in specific. Here is a general advice: if you do not know how to use/configure a command you can always enter
to get the "man[ual] page" of command. This works even for man itself, so man man will tell you how to use man. The works not only for commands but also standard configuration files. Enter, for instance,
to get information about the file /etc/filesystems, which denotes all the mountable filesystems in a system.
(Tip: the paginating program used in man is more which navigation keys match the ones of vi. Scroll down a line with "j", scroll up a line with "k", etc..)
If you are not sure which command to use you can search all the man pages for a specific term with the man -k keyword (or its more eponymic alias apropos keyword) command, which will list all the man pages containing keyword.
@ bakjunin: Yes sorry, was just looking at the threads title.
@ kwliew999: No, man is same for both, but tar is like compress.
Sorry for the irritation.
But either way, these kind of commands usualy provide arguments to overwrite (or not) any possible conflicting files.
And terminal commands usualy come along with (sometimes just either one of) these arguments:
Which i prefer on many occasions, since i can grep for keywords, which i'm not aware to do in manpages.
Helps alot to get quicker to the helpfull 'part'.
Hi
When I do on console a stop, the script prompts for password
> stop_idm_suite.sh
Suite system password:Here experct of the shell script stop_idm_suite.sh
DoIt()
{
# prompt System password
echo ""
${BMC_JAVA_HOME}/java -Didm.suite.home=${BMC_IDM_SUITE_HOME} -classpath... (1 Reply)
I have to run a script provided by a vendor. Its an executable so I can't change it.
basically after I call it it prompts me for a password. The script does not provide a way for me to pass a password with the command that calls the script.
I would like to automate running this script from... (5 Replies)
Hi,
I want to change the shell prompt, using the cd command.
I have a shell prompt like this -
p78-mfx(dgaw1078/9781)$
Now i do this -
p78-mfx(dgaw1078/9781)$ cd log4j
here the shell prompt should change like this -
p78-mfx(dgaw1078/9781)log4j$ (6 Replies)
Hi
How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Hi All experts, I was asked some questions of late & i was not aware of these. 1Q. how much we can pipe in shell prompt ?2Q. how many arguments we can pass in shell script & how to print that ? (eg, if i want to know what I passed in 11th Argument) ( for 3rd argument we can do echo $3, but I think... (7 Replies)
Hi,
I saw something in weird in Shell prompt.
I did the following steps
1) Typed ls -l and pressed ESC without entering
2) Typed "v" (please notice that I did not type "i" after "v"), which opened vi editor
3) I see the "ls -l" command that I typed in shell prompt
4) Without modifying... (6 Replies)
currently, I set my prompt in my .cshrc file as:
set prompt = "%B%h %m %P %/ \n% "
I have to use certain shells for some specific tasks and would like to set different prompts depending on the type of shell that I am using. Any advice?
Thanks (3 Replies)
Hi, I´m using SCO Unix 5.0.5 and I want to configure de variable PS1, so when I type the command:
cd /etc/
the prompt shows
/etc/_>
Is that possible with sh shell? I´ll appreciate your help.
Thanks, a Happy New Year! (1 Reply)
When I login to a specific machine (running Solaris 2.8; actually serveral machines behave this way), with a known good account, I don't get any shell prompt, and no screen responses to various commands such as ID and PWD. Any ideas on what is causing this, and how to change this behavior? (2 Replies)