General :: Executing Shell Script - Setting Permissions And Providing Path

Jan 4, 2011

I've been looking around the net for executing a shell script. My basic understanding is that after setting executable permissions and providing a path (#!/bin/sh) in the first line of the script, I can type ./myscript to execute instead of sh myscript. This is not working for me. I can run "sh myscript" but not "./myscript" even though I know for sure I have across the board execute permission and my sh path is correct. I'm working on a redhat linux station.

View 6 Replies


ADVERTISEMENT

General :: Executing Shell Script With 654 Permissions Inside Another One

Apr 22, 2010

I have this scenario, where in I'm calling a shell script inside another shell script. The only criteria here is that the embedded script will have 654 permissions and the master script should be able to execute this embedded script. The sample code is given below:

#!/usr/bin/ksh
maindir=/usr/home01/temp/dir
bindir=${maindir}/batch/bin
${bindir}/test.ksh -d ${dblogin} -i ${datadir} -r ${filedt} > ${tmp_log}

The test.ksh which has 654 permissions is called by the main.ksh script and when I try to run it using ./main.ksh, it fails with the error "Execute permissions denied."

View 2 Replies View Related

General :: Read And Execute Permissions For Executing The File

Mar 2, 2010

Binary files need only execute permission to execute. No read permission is required. But all executable files must be read by the kernel into main memory before executing. Also script files need both read and execute permissions for executing the file.

View 5 Replies View Related

General :: Executing A Shell Command In Emacs?

Dec 17, 2010

I tried to execute a shell command by M-! cmd RET but it did not work.M-! does not turn up in the microbuffer no matter how many times I press Alt+!.But if I go to Tools menu and select Shell Command... option then it writes M-! to the microbuffer and everything works fine.What is the problem here?

View 2 Replies View Related

General :: Shell Script Executing Automatically?

May 16, 2011

I want login.sh shell script executing automaticaly whenever i open the console..?and also logout.sh shell script executing automaticaly whenever close the console.

View 1 Replies View Related

General :: Executing .sql Files In Shell Script?

Nov 22, 2010

i have n files and each file has 5-6 .sql files.Now I need to wrie a shell script that executes all the n files in parellel and for each n file the .sql files sequentially.eg

CRM_File CM_file AP_file
crm_file_1425.sql
cm_file_5789.sql
ap_file_4124.sql

[code]....

run CRM_File CM_file AP_file in parellel and each file under CRM_File,CM_file,AP_file sequentially.

View 6 Replies View Related

General :: File Permissions In Every Element Of Path Or Just Last One?

Dec 17, 2010

Kernel 2.6.21.5, slackware 12.0 For a given app run by me as user john to be able to create a file in /foo1/foo2/, what do I need? (a) john to have write permissions in /foo1/? (b) john to have write permissions in /foo1/foo2/? (c) john to have write permissions in both /foo1/ and /foo1/foo2/? Any hint will be welcome. Note: No. It's not homework. KTorrent complains when trying to create the files being downloaded, saying 'permission denied'. But I think he is being run by another user. I can explain in a different thread.

View 3 Replies View Related

OpenSUSE :: Path Not Working When Executing From Script?

Jul 26, 2010

I use tcsh. When I execute by hand a command that is in my path...located in say "~/bin/myscript"....the command executes without an issue. I don't need to use the absolute path "~/bin/myscript", I can simply type the command "myscript" since the path "~/bin" is in my .tcshrc file. When I execute the same command from a script, I get a "command not found" error. A similar issue is when I use the absolute command, but a library necessary the programs' execution is defined within my .tcshrc file. I'll get a library not found error.

View 5 Replies View Related

General :: Samba File Permissions For Multiple Groups In The Same General Path?

Nov 4, 2009

I'm using my Linux (SLES 10) server as a File Server at this point. I need to set File Permissions to nested folders differently to different groups. For example:

homesharedengineering* should be read only for groupA
homesharedengineeringadmin should be read & write for groupB Plus read only for groupA
homesharedengineeringautocad should be read & write for groupC Plus read only for groupA

I've been using Webmin and Putty to set permissions but Putty only allows me the Default Group, it won't allow me to set several groups on the same directory. Webmin seems to allow me to add multiple groups (Webmin --> Others --> File Manager --> Info & ACL tab will provide extended abilities) but when I add multiple groups, they don't seem to take effect? I'm wondering if my setup at the 'Share' level or at the hierarchy of my folder structure (unix based) needs to be set specifically?

View 1 Replies View Related

General :: Setting An Executable To Be In Another's Path?

Dec 6, 2010

I have program (command line) that requires another program be installed and in its path. So I downloaded the file (.tgz), and extracted. I followed the compile and make instructions and ended up with a folder on my desktop that contains the excutable but is not in the path of the the other program. How can I do this..I think that I have about 20 more .tgz files to do this with.

View 2 Replies View Related

General :: Setting PATH Variable For New Users?

Jan 30, 2010

What steps have to be followed for having customized contents of PATH environment variable whenever new users are created? I require this in order to include a special directory into PATH variable; and this has to be a default one for all the newly created users.

View 3 Replies View Related

General :: Unable To Setup PATH Using Shell Script?

Feb 14, 2011

I am creating one bash script name as pathsetup.sh.

In that , I am trying to setup a path to my user profile. S my script content is as follows,

pathsetup.sh contains,
#!/bin/bash
MY_PATH=/home/arun/NS3/ns-3.9/build
export PATH=$PATH:$MY_PATH
echo "$PATH"

If I run the script, when run time it shows the MY_PATH added to PATH.

But, when I check it in terminal after run, it doesn't add the PATH.

if I put echo $PATH in terminal, it show old path.

How can I add path permanently to a user.

I read, ~.bash_profile , we can add the path permanently for a user.

But, I want to add MY_PATH for a specific time. I don't want any user change the file .bash_profile each time.

Just running the pathsetup.sh script, MY_PATH should be added to the user PATH.

Instead of .bash_profile, using shell script, can it possible to add path permenetly for a user.

View 2 Replies View Related

General :: Setting JAVA_HOME - What Is The Default Path They Are Installed

Dec 30, 2009

I installed "jdk1.6.0.bin" and "jre1.6.0.bin" successfully. But I don't know where they are installed. I can't find anywhere. What is the default path they are installed.I want to set JAVA_HOME.

View 1 Replies View Related

General :: Setting PATH Variable To Bin Directory In Ubuntu

Feb 18, 2011

I installed java in my pc by running the following on the shell
./jdk-6u24-linux-i586.
I need to set the path to the bin directory and also a new environmental variable JAVA_HOME.

View 2 Replies View Related

General :: Shell Script - Use Variable In A For Loop With Directory Path?

Jan 19, 2011

I modified files in several directories, and need to run a diff on the backup I created before modifying the file.

I'm trying to compose a simple shell script to speed up the task, but getting a syntax error.

Here is what I have:

for i in DIR1 DIR2 DIR3 DIR4 DIR5 do;
diff /maindir/subdir/subdir/$i/filename.txt.old /maindir/subdir/subdir/$i/filename.txt;
done

I know the paths are valid, and if I run just the diff command with the actual DIR1 instead of $i it works.

View 2 Replies View Related

General :: Command Line - Get Relative Path From Two Absolute Paths In Shell?

May 13, 2010

We have two paths. First one is directory, second either dir or file.

/a/b/c and /a/d/e.txt

Relative path from first path to second will be: ../../d/e.txt

How to get it in linux terminal?

PS: For those who ask "what is use case?" - creating lots of relative symlinks (just as an example)

View 1 Replies View Related

General :: Shell Script Is Defined In Someother Directory - How It Is Being Invoked With Path

May 30, 2011

extract.ksh use this scripts topic_file_publish.sh but extract.ksh resides in /data/apps/pnbos/scripts

but topic_file_publish.sh in below directory/data/apps/pnbgstk/publication >

ls topic_file_publish.sh topic_file_publish.sh fraespappp8:/data/apps > type topic_file_publish.sh topic_file_publish.sh is hashed (/data/apps/pnbgstk/publication/topic_file_publish.sh)

How it is done?

since topic_file_publish.sh is being directly referenced in the code with absolute path.

View 2 Replies View Related

Ubuntu Servers :: Script Not Executing On Reboot (with 755 Permissions)

Feb 18, 2010

I am trying to get a start up script to work, I have a file /etc/init.d/blah (with 755 permissions) with the contents [URL]. I have run "update-rc.d -f blah defaults". But when I reboot the script is not executing.

View 1 Replies View Related

General :: Setting Permissions On Unzip?

Apr 2, 2010

I wanted to assign ownership of my choice to my zip file while unzipping so I am using the command:

unzip yourfile.zip|awk -F": " '{print $2}' | xargs chown user.group

I also want to give 705 permissions to all directories and 777 to all files on unzipping?

View 3 Replies View Related

General :: Freenas Setting Up Permissions

May 29, 2010

I have set up freenas with 3 1tb hard drives. I have set up the SMB shares for the drives and can view each shared drive from each of the machines on my network. I can copy files from the hard drives, on the freenas but when I try to copy a file to the Freenas hard drives I get a message that I need permission to do this. I have all my shares set as anonymous how do I change the permissions so that I can save files to the drives.

View 1 Replies View Related

General :: Setting Permissions For UGO In One Command?

May 20, 2011

'the command I would use to change the group permission to write and the user and other to read and execute for the file "generate-report"' Sounds simple enough but I cant get it to work at all, tried doing a search in google and on the forums here to no avail. Is it possible to do in one command or will I need two?

Ive tried:

chmod g+w, uo+rx generate-report

And numerous other variants all with no luck.

View 3 Replies View Related

General :: Write A Shell Script Which Will Read The Directory Path As Input From User?

Nov 28, 2010

I am new to writing shell scripts. So, please bare with me. I am currently trying to write a shell script which will read the directory path as input from user and will traverse the Dir tree to find all available audio and video files. I have tried to write as much as I could but I don't know where I am making mistake as I get some files to be audio file which are actully tar balls. On the second note there are some files which video but script shows them to be audio. And, some video files are completely skipped. I am giving the shell script below so that you can see. I am using two external files as source which I am attaching.

Code:

#!/bin/bash
#Let's load the extensions that we want to search for
vdExt=$(cat vdExtList)
adExt=$(cat adExtList)

[code]....

View 5 Replies View Related

Programming :: Executing Shell Command In JSP

Aug 24, 2010

what we are trying to do is, to let the customer click a button in the web browser, and then the web server to call a shell script to do the work. The output from the stdout && stderr of the script should be displayed in the web browser once finished or timeout, along with the exit code of the script.

The shell script is however not on the web server, but on another app server. So to call this script from the web server as the identity 'tomcat':

Code:
$ sh appuser@app-server:$appbin/app-script

The .ssh/id_rsa.pub thing is done, and we have no problem doing this in the command line so far.

Our loaded ex-colleage has left us the webpages (jsp) with code like these:

Code:
<%@ include file="jsp_functions.jsp" %>
<%
String cmd = "sh $appbin/app-script";
ExecResult r = new ExecResult();

[Code].....

View 6 Replies View Related

General :: Write Shell Script That Takes A File Path As Command-line Arguments?

Dec 14, 2010

How can i write a shell script that takes a file path as command-line arguments.and it should report whether the path denotes a file or a directory.

View 2 Replies View Related

General :: Setting Permissions For Specific User And Groups?

May 25, 2010

i wonder, why nobody has written about it ...

How can i grant permission for files to specific user or specific group ??

Updated:

We have 3 groups: "g12" ("u1" and "u2), "g34" and "g56".

"g12" should only read the file.

"g34" should write and read it.

"g56" should have all permissions (rwx).

And others should not access the file at all.

View 3 Replies View Related

General :: Setting Up Group Permissions For A Mounted Share?

Jul 6, 2010

Sorry if this is the wrong section for this type of question. Anyway, I have two servers running Ubuntu 10.04. Server A has an NFS share that is mounted on server B, and the former has this share set up with specific permissions for a group called netusers. This group basically grants its users read/write permissions, and blocking all of files from anyone who's not part of the group.My question is this: how can I set up the permissions on server B, such that if I was to add a new user on server B, he would have read/write access to the share? I tried adding a counterpart group called netusers with the same permissions on B, but that didn't work.

View 2 Replies View Related

General :: Setting Execute Permissions On Second Hard Drive

Apr 4, 2011

I am running Linux Mint on my primary hard drive, and I would like to access some folders I have on my second hard drive, which has Windows XP installed on it. However, whenever I try to use these folders, I am greeted with the error message, "The file is not marked as executable." While I know how to set files as executable whenever I am using folders on my Linux drive, whenever I try to set such permissions on my XP folders, I can't seem to make it work. The files revert to their former status, and I'm told that I don't have permission. Should I set the files as sharable from within XP, so that they aren't marked as read-only? Or is there another solution I've missed?

View 8 Replies View Related

General :: Setting User Mountpoint Permissions In Fstab Without Uid / Umask

Jan 30, 2010

I'm struggling to understand an aspect of mounting and mountpoints with /etc/fstab. There is a large number of sites and threads that make recommendations using things like uid, gid, umask, and other options. These methods, however, which I've used, are file-system specific, useful only for filesystems such as (V)FAT and NTFS that allow them.My current situation is that I am mounting partition /dev/sdb5 in, let's call it /media/myMount. My goals:Mount this partition automatically upon boot using /etc/fstab...The partition should be fully accessible only to a specific user or group.What I've done is create the mount point in /media:

If user michapma were to carry out the mount, I believe it would work; however, I want the mount to happen automatically during boot. So, how can I achieve my user (or group) permission goals for this and any other such partitions using fstab?The manpage for mount has been helpful, but after reading many tutorials and forum threads, the only way I know how to do it is to have the user do the mounting or rely on the file-system specific options.

View 2 Replies View Related

General :: Setting Read Permissions Of A Directory For Root User Only?

Mar 21, 2010

I'm using ubuntu 9.10. I used the command:

root@aduait-laptop:~# sudo chown -R root:root /media/104B-FF96/Private to set the permissions of Private folder for root but it is giving error:

Code:
root@aduait-laptop:~# sudo chown -R root:root /media/104B-FF96/Private
chown: changing ownership of `/media/104B-FF96/Private/5.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/6.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/7.jpg': Operation not permitted

[Code].....

View 5 Replies View Related

General :: Recreate A User With/without Impacting Existing Filesystem/permissions/shell?

Jun 1, 2010

I am trying to run a cron job as an oracle user. I put the user in the cron.allow file but it still won't run. Other users are able to run a cron job though. I think it's the way the oracle user was created and I wanted to recreate it. However it owns a lot of other file systems as well as the database. Is there a way to recreate or reset the oracle account without impacting what is currently in place?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved