Command - filename as arguments - make executable to all users.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Command - filename as arguments - make executable to all users.
# 1  
Old 11-05-2014
Command - filename as arguments - make executable to all users.

Edit: Sorry. Mistakenly posted - please delete

Last edited by Reddax; 11-05-2014 at 10:05 AM..
# 2  
Old 11-05-2014
Where is the difficulty?
An alias suffice e.g.
Code:
alias chmod4all='chmod 755 $1'

# 3  
Old 11-05-2014
Edit: Thanks.
# 4  
Old 11-05-2014
Hello Reddax,

Following is an example for dealing with multiple files as arguments.

Code:
cat test343435.ksh
function check_files ()
{
for i in $*
do
        ls -ltr $i
done
}
check_files test440 test441 test443 test455

Output will be as follows.
Code:
-rw-r--r-- 1 singh06 singh06 513 Nov  5 06:21 test440
-rw-r--r-- 1 singh05 singh05 513 Nov  5 06:48 test441
-rw-r--r-- 1 singh05 singh05 46 Nov  5 06:50 test443
-rw-r--r-- 1 singh05 singh05 1169 Nov  5 08:02 test455

Note: This is just an example, which you can take it as a first step.


Thanks,
R. Singh
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

My awk executable is not printing FILENAME...: why?

Hello, there! I am running an executable awk script with 'source.awk input_file' and found that when I need to print FILENAME, or ENVIRON or even FNR nothing happens ... However, if I run it with 'awk -f source.awk input_file', then those variables are printed... What is the reason for that... (1 Reply)
Discussion started by: fbird3
1 Replies

2. Shell Programming and Scripting

My awk executable is not printing FILENAME...: why?

Hello, there! I am running an executable awk script with 'source.awk input_file' and found that when I need to print FILENAME, or ENVIRON or even FNR nothing happens ... However, if I run it with 'awk -f source.awk input_file', then those variables are printed... What is the reason for that... (6 Replies)
Discussion started by: fbird3
6 Replies

3. Shell Programming and Scripting

Bash script make itself executable

Is there a way to make this make itself executable? Thanks. :-) cat > somescript.sh << \EOF #!/bin/bash block_count=$(sudo tune2fs -l /dev/sda1 | awk '/^Block count:/ {print $NF}') reserved_block_count=$(sudo tune2fs -l /dev/sda1 | awk '/^Reserved block count:/ {print $NF}') perl -e... (4 Replies)
Discussion started by: drew77
4 Replies

4. Homework & Coursework Questions

Make a file accept only two arguments from the command line

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: 1) The script is executed in the Korn shell. 2) Name the shell script file is asg6s. 3) The asg6s file is... (7 Replies)
Discussion started by: ProgMan2015
7 Replies

5. Programming

Make a file accept only two arguments from the command line

DELETED (2 Replies)
Discussion started by: ProgMan2015
2 Replies

6. Homework & Coursework Questions

I need to make a script that has 4 command line arguments to function properly.

I have no idea what the following means. The teacher is too advanced for me to understand fully. We literally went from running a few commands over the last few months to starting shell scripting. I am not a programmer, I am more hardware oriented. I wish I knew what this question was asking... (3 Replies)
Discussion started by: Wookard
3 Replies

7. Shell Programming and Scripting

run and make an executable file

as i said before i'm a beginner in shell programming and i have two questions: how to run an executable file in shell scripts like for example let's say the file called "prog.exe", what's the shell command to run this file? also how can i make the shell file an executable file (if it is... (5 Replies)
Discussion started by: _-_shadow_-_
5 Replies

8. Shell Programming and Scripting

How to read arguments to make command

In the make file update updateq: ------------------- ---------- i want the makefile to display some messages when user gives "make update", but totally quite wehn user enters "make updateq". Can u tell me how to read these argument in makefile. $1 doesnt work:( (3 Replies)
Discussion started by: vikashtulsiyan
3 Replies

9. Shell Programming and Scripting

Make new arguments for echo command

Hi everybody, i want to make an argument at echo command that takes a alpharithmetic and returns it reversed. How this can be done? plus what makefile changes are needed (0 Replies)
Discussion started by: Panteras
0 Replies

10. Solaris

How to make a script executable by all users?

I have a script in my home direcroty which upon execution gives the essential system information like memory,cpu etc and is currently owned by root:root. Now I want to see that every non root user will run this file and grab the reqired system info. I know this is some thing associated with chown... (2 Replies)
Discussion started by: chrs0302
2 Replies
Login or Register to Ask a Question