Sponsored Content
Top Forums UNIX for Dummies Questions & Answers tar xzCf --mode doesn't work. Post 302559346 by volbod on Monday 26th of September 2011 10:49:38 PM
Old 09-26-2011
Yes. Looks like I missed the point that the --mode is applicable only while "adding" the files and not during extraction.

Code:
[ ~/test]$ !touch
touch x y
[ ~/test]$ !ch
chmod 777 x y
[ ~/test]$ ls -l x y 
-rwxrwxrwx 1  g660 0 Sep 26 19:46 x 
-rwxrwxrwx 1  g660 0 Sep 26 19:46 y 
[ ~/test]$ umask
22
[ ~/test]$ tar cvzf a.tar.gz . --mode a-w
./
./x
./y
./a.tar.gz
[ ~/test]$ tar -tvzf a.tar.gz 
dr-xr-xr-x /g660     0 2011-09-26 19:46:50 ./
-r-xr-xr-x /g660     0 2011-09-26 19:46:50 ./x
-r-xr-xr-x /g660     0 2011-09-26 19:46:50 ./y
-r--r--r-- /g660     0 2011-09-26 19:47:07 ./a.tar.gz
[ ~/test]$

And if I need to be doubly sure that while untarring the "w" permissions are indeed knocked out, then i just need to set the umask as 222.

Was hoping to be able to provide the umask as part of the "tar" command (to untar) itself ; instead of setting umask to 222 and resetting it back to the original value.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why doesn't this work?

cat .servers | while read LINE; do ssh jason@$LINE $1 done exit 1 ./command.ksh "ls -l ~jason" Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing? Thanks! JP (2 Replies)
Discussion started by: jpeery
2 Replies

2. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

3. Shell Programming and Scripting

What to do when mtime doesn't work?

I have a folder that I need to search for new files and copy on the latest. I've been using "-mtime -1" in my command line but it doesn't seem to work. I've been meaning to fine a different script because files are dropped into the folder all day long and because of the -mtime, I've only be... (19 Replies)
Discussion started by: bbbngowc
19 Replies

4. Shell Programming and Scripting

HELP: If Doesn't Work in AWK

Hi! I have a somehow big file (almost 3000 lines long and thirteen columns). Some lines have no value at all or, at least, are incomplete. The columns' values that have no data are marked with a "-" and the corresponding line (the line that owns that value) should be discarded and not used. ... (5 Replies)
Discussion started by: Marcelo de Brit
5 Replies

5. Solaris

shutdown -y -i5 -g0 DOESN'T work

hello, The command above seems not working on my solaris 8/9 sparc machines. a. resulted to the ff below when I instead use "shutdown" only. Broadcast Message from root (pts/1) on "hostname" date.. The system "hostname" will be shut down in 30 seconds THE SYSTEM bdosg IS BEING SHUT... (4 Replies)
Discussion started by: lhareigh890
4 Replies

6. UNIX for Dummies Questions & Answers

Emacs starts in c++ mode but doesn't use c++ setup

Hi, I'm trying to use Emacs to edit C++ files (extension .cpp). My ~/.emacs file contains: (defun my-c++-indent-setup () (setq c-basic-offset 4) (setq c-default-style "linux") ) (add-hook 'c++-mode-hook 'my-c++-indent-setup) When I open a C++ file in Emacs, it's in C++ mode (the... (1 Reply)
Discussion started by: linuxnoob12
1 Replies

7. Shell Programming and Scripting

My if statement doesn't work why?

I have the following and for some reason I can't have two options together. I mean if I choose -u and -p it won't work... why? #!/bin/bash resetTime=1 mytotalTime=0 totalHour=0 totalMin=0 averagemem=0 finalaverage=0 times=0 function usage() { cat << EOF USAGE: $0 file EOF } (10 Replies)
Discussion started by: bashily
10 Replies

8. UNIX for Dummies Questions & Answers

Why doesn't this work?

find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \; Returns this failure: mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies

9. Shell Programming and Scripting

-ne 0 doesn't work -le does

Hi, I am using korn shell. until ] do echo "\$# = " $# echo "$1" shift done To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work. Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies

10. Shell Programming and Scripting

Timeout doesn't work, please help me

#!/bin/sh trap "cleanup" TERM timeout=5 mainpid=$$ cleanup() { echo "at $i interupt" kill -9 0 } watchdog() { sleep $1 } (watchdog $timeout && kill -TERM $mainpid) & run_test() (10 Replies)
Discussion started by: yanglei_fage
10 Replies
XmScrollVisible(library call)											     XmScrollVisible(library call)

NAME
XmScrollVisible -- A ScrolledWindow function that makes an invisible descendant of a ScrolledWindow work area visible SYNOPSIS
#include <Xm/ScrolledW.h> void XmScrollVisible( Widget scrollw_widget, Widget widget, Dimension left_right_margin, Dimension top_bottom_margin); DESCRIPTION
XmScrollVisible makes an obscured or partially obscured widget or gadget descendant of a ScrolledWindow work area visible. The function re- positions the work area and sets the specified margins between the widget and the nearest viewport boundary. The widget's location relative to the viewport determines whether one or both of the margins must be adjusted. This function requires that the XmNscrollingPolicy of the ScrolledWindow widget be set to XmAUTOMATIC. scrollw_widget Specifies the ID of the ScrolledWindow widget whose work area window contains an obscured descendant. widget Specifies the ID of the widget to be made visible. left_right_margin Specifies the margin to establish between the left or right edge of the widget and the associated edge of the viewport. This margin is established only if the widget must be moved horizontally to make it visible. top_bottom_margin Specifies the margin to establish between the top or bottom edge of the widget and the associated edge of the viewport. This margin is established only if the widget must be moved vertically to make it visible. For a complete definition of ScrolledWindow and its associated resources, see XmScrolledWindow(3) RELATED
XmScrolledWindow(3). XmScrollVisible(library call)
All times are GMT -4. The time now is 09:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy