07-29-2004
Does "gzip" have a no prompt option on it for overwriting if file exists?
So I dont enounter things like:
gzip: /sometimename.gz already exists; do you wish to overwrite (y or n)?
Want to add it into a script and if there is a file aready there to just overwrite it, otherwise the script will hang unless there is manual intervention.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hallo,
i need a Prompting read in my script:
read -p "Enter your command: " command
But i always get this Error:
-p: is not an identifier
When I run these in c-shell i get this error
/usr/bin/read: read: bad option(s)
How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I was wondering if anyone knows the command (using Solaris) to register a file in RCS without getting the prompt to enter a description.
Thanks for any help!
js (0 Replies)
Discussion started by: js8765
0 Replies
3. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
4. Shell Programming and Scripting
Hello All,
I am trying to gzip a directory contents with the option "-r". The file timestamps remaining same but not the directory, how to retain it too.
ex:
$ ls -l 20090624065000
total 1213360
-rwxrwxrwx 1 cisa users 529513119 Jun 24 2009 A
-rwxrwxrwx 1 cisa ... (2 Replies)
Discussion started by: panyam
2 Replies
5. UNIX for Dummies Questions & Answers
Hi Guys,
I'm sorry but I can't find answer for this, what is the meaning of -s option in "if" statement on unix scipting. Please see sample below:
opath=/home/output
for i in N1 N2 N3 N4
do
echo $i
if
then
grep $i $opath/N5_CRAI > $opath/N5_$i.crai
chmod 777 $opath/N5_$i.crai
... (7 Replies)
Discussion started by: rymnd_12345
7 Replies
6. UNIX for Advanced & Expert Users
Hello,
I want to gzip some files before copying to remote host. There is no freespace on source host so it needs to be perfomed within one-liner. I tried the following but it didn't work
gzip -c -9 all_rvds.xml |ssh targethost "dd of=/tmp/all_rvds.xml.gz"
cat all_rvds.xml |gzip -c9 |ssh... (5 Replies)
Discussion started by: urello
5 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
We have an archiving script on our applications box. It is scheduled to run at 36th minute every hour.
36 * * * * /archive_7.sh
But it throws an error saying "sh: /archive_7.sh: not found". I am not able to understand why.
# ls -l /archive_7.sh ; file /archive_7.sh
-rwxr-xr-x ... (4 Replies)
Discussion started by: satish51392111
4 Replies
8. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
9. UNIX and Linux Applications
Hi Everyone,
We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is... (2 Replies)
Discussion started by: thiyagoo
2 Replies
10. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
setenv(3C) setenv(3C)
NAME
setenv(), unsetenv() - add, update or remove an environment variable
SYNOPSIS
Parameters
envname Points to a string containing the name of an environment variable to be added or altered. This should not be a NULL
pointer or null string, and the string should not contain an equal character.
envval Points to a string containing the value to be set for the variable envname.
overwrite Indicates whether to overwrite the value of envname variable or not, if it already exists. Expected values are non-zero
and zero. If the environment variable does not exist in the environment, then the value of this variable is ignored.
DESCRIPTION
and functions update the environment of the calling process.
If envname does not exist, the function ignores the value of overwrite and adds the variable envname to the environment with the value
envval. If envname exists and overwrite is non-zero, then the variable envname is updated with the new value envval. If envname exists
and overwrite is zero, then the variable is not updated, and the function is considered to have completed successfully.
The function deletes the variable envname from the environment, if it exists. If the envname variable does not exist in the current envi-
ronment, the environment is unchanged, and the function is considered to have completed successfully.
If the application modifies environ or the pointers to which it points, the behavior of and is undefined.
EXTERNAL INFLUENCES
Locale
The category determines the interpretation of characters in string as single- and/or multi-byte characters.
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
The and functions return zero on success; otherwise they return and set to indicate the error.
ERRORS
If the function fails, is set to one of the following values:
Sufficient memory is not available to add a variable or its value to
the environment.
The envname argument is a null pointer, points to an empty string, or points to a string containing an equal character.
If the function fails, is set to the following value:
The envname argument is a null pointer, points to an empty string, or points to a string containing an equal character.
EXAMPLES
The following code adds a new environment variable to the current environment.
The following code updates the variable
The following code removes the variable from the current environment.
WARNINGS
The and functions manipulate the environment pointed to by environ, and can be used in conjunction with However, envp (the third argument
to main) is not changed.
The uses to enlarge the environment (see malloc(3C)).
After the or function is called, environment variables may not be in alphabetical order.
AUTHOR
and were developed by HP.
SEE ALSO
exec(2), getenv(3C), malloc(3C), putenv(3C), environ(5), thread_safety(5).
STANDARDS CONFORMANCE
setenv(3C)