Programming :: Print Message When Changing Directories

Jul 21, 2010

I need some direction on a small scripting question. I've been doing some development and storing the code on a network drive with multiple user access. My development is getting complex enough that it is time to set up a svn repo for it. I would like to set up a little script (if possible) that prints a message/reminder to whomever is accessing the code directory stating that the code is ultimately stored in svn and any changes need to be checked in, etc. Is there a way to have linux print a message to the screen based on a 'cd /specific_dir/' command? So far google is mum on the topic. Using Debian and bash shell.

View 5 Replies


ADVERTISEMENT

Programming :: Print Physical Address Of Page Directories For All Processes?

Apr 4, 2011

How to printing physical address of page directories for all processes?

#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>

[code]....

View 1 Replies View Related

Programming :: Why Doesn't The Javax Swing Message Print

Mar 18, 2010

why the message string isn�t output to the Applet window in the code below?

Code:
import javax.swing.*;
class printit extends JApplet {

[code].....

View 4 Replies View Related

Programming :: Awk: Print Out A Message To The Screen When Redirecting The Output To File?

Mar 15, 2010

I have a problem when using awk:

e.g: awk '{processing text}' File1 > File2

But when I'm processing the File1, I want to print out some messages to the screen (not the File2). How can I do that?

View 5 Replies View Related

Programming :: Print A Message When A Diff Shows Files Match?

Jul 16, 2009

I'm writing a script using ksh that diffs two dirs that contain about 30 files, and writing the results on a logfile. When files differ, it writes the difference with no problem, but I also need the script to write a message if no differences are found.

View 3 Replies View Related

Fedora :: Cannot Compare Two Directories And Print Files

Sep 12, 2010

I have to write a script that accepts two directory names (JIIT, JUIT) as positional parameters and checks which files are identical in both directories and files having same contents are also considered as identical in same directory. I tried using diff:

#both directories contain three files...file1, file2, file3
echo "Enter the directories:"
read d1
read d2
cd $d1

if diff file1.sh file2.sh > /dev/null
then echo same 1,2
else echo different
fi

if diff file1.sh file3.sh > /dev/null
then echo same 1,3
else echo different
fi

if diff file2.sh file3.sh > /dev/null
then echo same 3,2
else echo different
fi

cd ../
cd $d2
.....

I used the same code in the other directory for the three files. This is not running. I also want to know what to do when I need to compare files from different directories. i.e., JIIT, JUIT..

View 3 Replies View Related

General :: Commands For Changing Directories In Fedora

Jan 19, 2011

What are the commands for changing directories in fedora linux i wanted to install something so i put it in my desktop and documents folder but i couldn't install becuase i couldn't change directories.

View 4 Replies View Related

General :: Minimize Typing When Frequently Changing Directories?

Aug 4, 2010

What are some good Linux commands to make switching between different directories on the command line easier?

I often have to switch between different directories with long names, e.g.

Typically, I use tab completion, so it's something like this:

But it's annoying because all these names are so similar, so tab completion doesn't really save much work.

What tricks do you use to minimize typing in such situations?

I do use pushd and popd sometimes, but here it won't help much because I don't visit the directories in a given order.

For a nice solution, see the accepted answer to my other, related question. Basically, just create an alternative cd command:

function cd2 { select a in $1*; do cd $a; break; done }

It will list all possible completions at once:

And you can pick one by typing its number.

View 6 Replies View Related

Ubuntu Installation :: Changing Software Install Directories ?

Jan 6, 2010

If it was possible to move the software install directory from the main drive to a secondary drive

I am using a ubuntu fork (mint linux) with a eee pc the primary drive is very small at around 3GB I've added my second drive to the fstab file in etc so it mounts on start up is there anyway I can make programs install to that second drive or to move my current applications to that drive?

View 3 Replies View Related

Server :: Changing CUPS Print Orientation?

Mar 2, 2010

In Windows printing I can take an 11 X 17 report, and tell the print manager to rotate and size. The job then prints (Xerox N40) aligned correctly.

Currently, even after telling the N40 it has ledger paper and switching it's orientation, my 11 X 17 reports print "down" the page rather than across.

Is it possible to tell CUPS to rotate the print job?

View 9 Replies View Related

Slackware :: Message - Enter Print Command ?

Aug 15, 2010

When running certain programs (i.e. Nedit or Gourmet Recipe Manager) asking to print will give the following message: Enter print command:

Am using 13.1 32 bit with cups. Everything works properly and prints properly I just don't know what to enter for a 'print command'.

Have tried entering lpr and cups.

View 3 Replies View Related

Security :: Group Write Access For Newly Created Files / Directories Without Changing Umask

Apr 3, 2009

I have several directories, each owned by root and a group of the same name,By setting the sgid bit, I made sure that newly created files and directories are owned by the correct group, and that directories have the sgid bit set too.On each newly created directory or file, the permissions are set to 755. This is because this is the default umask, and I cannot change a users umask. I actually only want files created below a particular directory to have group write access, inheriting this behaviour to newly created directories properly.I'm not on samba or NFS, I have to do this for SSH users.The filesystem is ext3.I started to fool around with ACLs, but couldn't find what I was looking for.

View 3 Replies View Related

General :: Changing The Default Welcome Message?

Nov 22, 2010

When the computer boots in Slackware 13.1 i get the default welcome message: "Welcome to Linux 2.6.33.4-smp (tty1)". How do i change it?

View 2 Replies View Related

OpenSUSE Network :: SAMBA - Changing Default Permissions On Files And Directories Created From Windows Clients

Mar 9, 2010

I have a fileserver running openSUSE 11.2 and samba services for file access from MS Windows based workstations. My question relates to changing default permissions on files and directories created from the windows clients.

Following are extracts of the /etc/samba/smb.conf file :

Even with the above entries, sometimes there are files and directories created by the windows clients having permission

Probably my lack of understanding in ACLS.

View 9 Replies View Related

Security :: Changing The Permission Denied Error Message?

Jul 9, 2009

Is it possible to change the general permission denied error. I have some rather young users on this system that think they can "hack the gibson" and I would love to change the general error message to something a little more rude/funnyex:# cd restricted area
-sh: cd: restricted area: Permission deniedI am curious if its possible to change the error message in general?ex:# cd restricted area-sh: cd: restricted area: (funny/rude message goes here)Quick info:This is a Gentoo 2008.0 system, I would also love to do this on my slacware and OpenBSD boxes as well just for kicks.

View 2 Replies View Related

Programming :: Create A Message Forwarder Program That Receive A Message On Port A And Pass It On T Port B?

Sep 6, 2010

We are trying to create a message forwarder program that receive a message on Port A and pass it on t Port B. Also receive a message from Port C and Pass it on to Port D as follows.

[Code]...

View 4 Replies View Related

Programming :: Socket Programming While Displaying Received Message In File

May 11, 2011

i have problem in socket programming, while displaying received message in file,i got a problem... i cant able to write it in the file.... this is the code....

Code:
/* tcpserver.c */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
[Code]....

now my problem is run time error i can able to create file but i cant able to write file....log.txt contain nothing.... as here i have give sample code... dont say not initialising function and all.... i have initialised , please only see func1() - my problem is only not able to write msg which i got received from the client..

View 2 Replies View Related

Programming :: Get The Directories Of A Directory?

Apr 4, 2011

I need to walk in folder recursively in C. To change the directory, I can use chdir, but how I can get the directories of a directory?

View 3 Replies View Related

Programming :: Check If Any Directories Exist, Except A Certain One?

Aug 5, 2010

I need to find if, in a folder any directories exist, except a certain one named "mes croquis".What I am trying to say, is that the re already is a directory named "my croquis", which I have to ignore. IF any other directory appears, I have to archive them.I got everything so far, except the starting condition.In other terms , I am lookign for something like this:

IF anyDir EXIST AND name != "mes croquis"
do something
else

[code]....

View 2 Replies View Related

Programming :: Searching File In Directories?

Feb 23, 2011

I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files

What I am doing in my script is

for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then

[Code].....

View 4 Replies View Related

Programming :: Determine Files And Directories?

Mar 9, 2010

i made a program to list all the files in a directory,is there a way to determine what are directories and what are files ?

View 5 Replies View Related

Programming :: How To Find Directories That Do Not Have A Certain File

May 28, 2010

I'm having problems figuring out the process to find directories that DO NOT contain a certain file. I have a mp3 collection that all the album art is name "folder.jpg". Not all the albums have images. I need a way to find the albums/directories that do not contain "folder.jpg". I can find the ones that do contain "folder.jpg" with

Code:
find . -iname 'folder.jpg' -print0 | xargs -0 ls >> album_art

but that is as far as my bash-fu can take me. I'm not really sure what my next step is.

My directory structure is like such: a-z/artist/album/folder.jpg

View 5 Replies View Related

Programming :: Makefile - Handles Directories ?

Dec 8, 2009

I'm trying to figure out how Make handles directories.

How can I modify this makefile so it will put all of the .o files in a separate build directory?

Code:

But make ignores this and still puts main.o in the base directory. And if I refer to the build directory in the dependencies for bandit, make complains about "no rule ..."

I want to keep main.cpp in the base directory, all other sources in the src directory, and all object files in the build directory.

View 14 Replies View Related

Programming :: Mod_rewrite Remove Sub-directories From URL?

Apr 25, 2011

I have tried this a million ways, got it to work once but it didn't work sitewide for some reason. I have a url: [URL] and I want it to be found by going to: [URL] I am using this

Code:

RewriteCond %{REQUEST_URI} ^/agents/tp/
RewriteRule ^([^/]+)/?$ agents/tp/$1/index.php [L]

and have also tried something as basic as

Code:

RewriteCond %{REQUEST_URI} ^/agents/tp/
RewriteRule ^(.*)$ agents/tp/$1/index.php [L]

I keep getting "The requested URL /JoeAgent/ was not found on this server." why it's not working?

View 4 Replies View Related

Programming :: Copy Files To Dynamic Directories?

Feb 14, 2011

I have been searching for a solution to the following problem:

When my distro of choice updates Firefox web browser, the directory name is '/usr/lib/firefox-<version>'.
The problem here is that the directory name is dynamic by nature and doesn't allow a simple static solution, e.g.
'cp -rf /usr/local/files/bookmarks.html /usr/lib/firefox/defaults/profile'.

The same quandary applies when adding extensions, changing prefs etc.
I have looked at the following commands:-
find, sed, xargs, grep, awk, fprint.
Unfortunately my grasp of syntax and programming is very simple at best.

View 2 Replies View Related

Programming :: Script That Displays The Directories Alphabetically?

Oct 29, 2010

I am supposed to create a script that displays the directories alphabetically with the size of each directory on the left hand size. I know you should use du to check for disk usage. So far i got the directories to display but not alphabetically.

Code:
du --max-depth =1
Example :
41921 Directory

View 2 Replies View Related

Programming :: Simple Script For Comparing Two Directories?

Apr 1, 2011

have a simple script for comparing two directories. I want to list all differences between this directories.

here is my function for compare:

function comp
{
for i in $1/*; do
if [ ! -e "$2/${i##*/}" ]; then
echo $i

[Code]....

in my script these two files are equal(my script ignored last time modified)

View 5 Replies View Related

Programming :: Perform The Operation In Script On Such Directories?

Dec 24, 2010

I have mounted remote Windows share using CIFS and writing bash script for those files. However being a windows share since there is a space between directory names like "Program Files" and hence I am not able to parse it through bash script and script exits with error.

Does any one have any idea about how to perform the operation in script on such directories?

e.g.
cd /tmp/temp/Program
Error: No such File or Directory
cd Files/
Error: No such File or Directory

View 3 Replies View Related

Programming :: Can Perl Move X Amount Of Directories

Jan 8, 2010

I'm in the midst of making a perl script and I was wondering if it was possible, to say, have a folder with 20 files in it, then move 5 files out of there, into a new one. I would like to to do this until the original folder has no more files in it, but I'm very stuck.

View 3 Replies View Related

Programming :: Finding Location Of Duplicate Directories

Jan 8, 2011

This simple task is proving harder then imagined. I have a multi-level directory that I'm trying to clean of duplicates, but I can't get 'find' to print what I need to see. To give an illustrative example, here is a dir:

Code:
stuart@stuart:~/testdir$ ls *
dir1:
level2:
dir1

So the output of find as i'd like it to work would show the two locations of dir1, which would be ./dir1 and ./level2/dir1. But no:

Code:
stuart@stuart:~/testdir$ ls -d */ | head -1 | find . "`cat`" -type d
.
./level2
./level2/dir1
./dir1
dir1/

View 2 Replies View Related







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