Programming :: C- How To Skip Dirs That Are Mounted Twice

Aug 27, 2010

I need to list a directory recursively but I want to skip subdirs that were already mounted. There are 2 cases:

a) a filesystem was mounted twice, like in this example:

- "/dev/sda2" was mounted on "/mnt/mnt_point1"
- "/dev/sda2" was mounted on "/mnt/mnt_point2"

I want to list "/mnt" but descend only in "/mnt/mnt_point1"

b) part of the file hierarchy was remounted somewhere else, with "mount --bind":

- "mount --bind /home/user/tmp/test /home/user/tmp/mounted_test"

I want to list "/home/user/tmp" but descend only in "test" "statfs" and "statvfs" don't offer any information to discern if a dir was mounted twice. One solution would be to read "/etc/mtab" (as "find" command does it) and perform some checks, but I think that this is pretty expensive (one has to read /etc/mtab every time one encounters a dir; if this file is read only when program starts, a mount could occur in between reads, so that the program will be inaccurate). Another solution would be to filter kernel events (via libudev or Netlink) and do this reading of /etc/mtab only when a MOUNT event was issued.

View 1 Replies


ADVERTISEMENT

Programming :: Go: A Cd/pushd/popd/dirs Replacement?

May 17, 2011

I have to use the older ksh on SUN and AIX alot...and kinda missed the pushd concept for jumping around a bunch of directories.but not really, because I didnt always want to pop off my directory, just wanted to cd there.So I wrote a ksh or bash friendly script with usage as below.Make it available by sourcing: . godir.sh

Code:
# Script: godir
# Written: 05-16-11 13:49:17 By: AWJurgensen

[code]....

View 1 Replies View Related

Programming :: How To Skip Getchar In C

Oct 1, 2010

I would like to read an input from keyboard using getchar. However, if no input (No Carriage return/new line none whatsoever) is given after say, 5 seconds, I would like to skip the getchar and move on. How do I do this in C. I'm using GNU compiler set.

View 6 Replies View Related

Programming :: Making The Mplayer To Skip Some Files?

Jun 6, 2010

GNU/Linux kernel 2.6, Slackware 12.0
MPlayer 1.0rc2-4.1.2
GNU Bash 3.1.17

I've got a set of MP3 files on dir .../foo/ and I want mplayer to play them sequencely but skipping some of them. If I run 'mplayer *' this will do but ofcourse won't skip any files. I think a shell script could be written to do that. It would be something like this (using some pseudocode):

#!/bin/bash
#After an example from Intro_Linux by M. Garret.
LIST=$(ls *.mp3)

[code]....

View 3 Replies View Related

Programming :: Skip Execution Of A Function In A Script?

Mar 15, 2011

I have a bash script which is composed of different functions.I want to able to select which functions to be executed when i run the script, for that i thought about using a flag in the function. but i dont know how to skip the function whose flag is set to zero.

Code:

myfunc1(){
local flag=1
commands
{

[code]....

View 2 Replies View Related

Programming :: Make Getchar() Skip A Leading Space?

Jul 10, 2010

How do I make getchar() skip a leading space? The situation I am looking is this: I print a prompt that ends in a space printf("Input: ");and then when I use getchar() to read the text that was typed after the prompt, it appears to process the trailing space as a leading space that belongs to the input.

how can the space be skipped, preferably without inserting code that explicitly checks whether I'm reading the first character or not. I have already found out that I can skip such a space using scanf scanf (" %c", &ch); where the leading space in the format string eliminates leading spaces from the input string. That is the sort of thing I have in mind.

View 7 Replies View Related

Ubuntu :: Removing Parent Dirs From Tar

Jul 30, 2011

I'm trying to use tar which I've used a bit before but have never had to do this so I'm unsure. I'm trying to remove parent dirs from the backup. example;

Code: tar cvpjf /path/to/backup.tar.bz2 /path/to/the/source I want the backup.tar.bz2 to only contain the contents of source. At the moment the contents of the backup.tar.bz2 have the following file structure /path/to/the/source/files. How can I remove the parent dirs from the backup.tar.bz2? Alternatively, How could I just extract the contents of source with out the above folder structure? at the moment when I extract the backup.tar.bz2, I get the full folder structure in the location that I extracted it to.

View 2 Replies View Related

General :: Bash Dirs Command And +N Option?

Feb 8, 2011

I'm trying to use the dirs command with the +N option. The manual says: dirs [-clpv] [+n] [-n]Without options, displays the list of currently remembered directories. The default display is on a single line with directory names separated by spaces. Direc- tories are added to the list with the pushd command; the popd command removes entries from the list. +n Displays the nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero.

dirs -v shows:
0 /dir1/
1 /dir2/
2 /dir3/

However, dir +n 1, dir +N 1, dir -v +n 1, dir -v +N 1 all give:

[Code]...

View 2 Replies View Related

General :: How To Find Root Files And Dirs In Some Dir

Oct 31, 2010

For example I have "/some/dir" which contains user's files and directories. I want to check if there are any files or directories of root. I guess I should use "find" command but what's the full command to find it out?

View 2 Replies View Related

General :: Need For Loop To Get Dirs And Run Bash Script

Jul 7, 2010

I have to format 4 years worth of awstats data "static" for a client and then move it to their new server.I don't want to run the commend to do this 48 times. If possible I would like to use a bash script that uses the folders in a directory so the script knows which year-month to do this for me and which folder to place the output in.

View 5 Replies View Related

Software :: Why GCC Includes Files From Unexpected Dirs

Nov 23, 2010

Now I'm porting a WIFI driver to my platform, MIPS little endian, Linux-2.6.18, uClibc environment for STB. And I'm experiencing some strange symptom. As you know, there are some kind of include files that system provides such like GCC-provided(usually in /usr/include), LIBC-includes(/usr/include), Linux-includes(${LINUX}/include/linux), ASM-includes(${LINUX}/include/asm) and so on, and there are many files resides different directories as the same name (e.g. time.h, types.h, limits.h ...) and many of them has
different contents.

I'm confusing because that some include files are read from unexpected directories.
The command line is like following. $ cross-gcc -o Target -I$(GCC_INC) -I$(LIB_INC) -I$(appl_inc) -isystem $(LINUX)/include -isystem $(LINUX)/include/linux Source.c

And some symbol means:

GCC_INC: directory for GCC include files.
LIB_INC: directory for LIBC include files.
LINUX: Linux kernel directory.

[code]....

As shown above, some include files are read from unexpected directory. This causes some severe compile errors. I've verified these by adding '-E' to the command line. How can I order GCC to read files from where I'm expect?

View 1 Replies View Related

General :: Shell Script - Make Dirs Filename

Jun 27, 2010

Trying to write a shell script called make to read a file called dirs with the following in it
programs
scripts
documents
Read file line by line and make the directories in the current directory when you type ./make dirs if no file is given then program should print usage:
make dirs filename

View 3 Replies View Related

Software :: Create Script That Run In Background 5 Programs From 5 Given Dirs?

Mar 23, 2011

Want create script that run in background 5 programs from 5 given dirs and all of them should be in one controlling screen. In other words how via script after created screen and attaching to it via screen -r via script vreate new window within that screen, run given program and detach for new itaration

View 7 Replies View Related

Ubuntu :: Command To View Disc Space Consumption By Dirs?

Jan 28, 2010

I am searching a GUI based "tree view utility" which shows me which directories consume how much hard disc space (cumulative, including recursively the sub directories; including hidden files). Is there such a tool fur Ubuntu/Linux and how do I install it? Is there at least a cmdline command which does the same job in terminal window?

View 1 Replies View Related

Debian :: Could Not Launch Application 'user-dirs-update-gtk.desktop'

May 2, 2011

I have this message in the syslog from squeeze:

Code:

May 2 21:18:19 squeeze x-session-manager[1732]: WARNING: Could not launch application 'user-dirs-update-gtk.desktop': Unable to start application: Failed to execute child process "xdg-user-dirs-gtk-update" (No such file or directory)

View 1 Replies View Related

Software :: Gitignore Not Ignoring Server Side Created Dirs?

Jan 26, 2011

I've got a Web app on a server, that may dynamically create some directories inside "/public/sites/medias" from the inside of the app. I've got no problem so far to tell Git to ignore everything _actually_ in "public/sites/medias", but the problem is when users begin to create new dirs and add files like these :

/public/sites/medias
---------------------/images
---------------------------/4

[code]....

View 1 Replies View Related

General :: Command For Listing Files/dirs Recursively Of Specific Directories?

Jul 22, 2011

suppose in my current directory, I have 50 sub-directories. Now, I am interested only in about 20 of those sub-directories (whose names match a pattern). I would like to recursively list the contents of these 20 sub-directories. How do I do that ? I would like to do this in Solaris 10 and Linux(RHEL 5.x).

View 3 Replies View Related

OpenSUSE Network :: Error - Vodafone Mobile Connect Needs The Following Files And Dirs With Some Specific

Sep 17, 2010

I have installed the files from Betavine - SuSE Linux Drivers and installed it by clicking the rpms and installing now the error is this- Vodafone Mobile Connect needs the following files and dirs with some specific permissions in order to work properly: /etc/ppp/chap-secrets should have 0660 mode, found 0666 /etc/ppp/peers should be readable and writtable by group root user Rob should be a member of group root

View 3 Replies View Related

Ubuntu :: Chown And Skip Dot And Dot-dot?

Mar 5, 2011

I issued chown '-hR <user>:<group> *' on a directory. chown also change dot and dot-dot in cwd and all subirectories. How do I go about recursively changing ownership without changing dot and dot-dot?

View 2 Replies View Related

Ubuntu :: Audio Files Skip Every Now And Then

Jul 6, 2011

Strange problem from a couple of months, Audio files skip every now and then. Sounds like buffering issue. MP3, Wav etc. all skip on VLC, Qamp etc, once in a minute or two, its quite random. i thought there was CPU spikes or something by some program i installed. I checked the system monitor and found no unusual spikes in the CPU... so i am thinking this must be the audio buffers. Can i set the buffers for the for the driver or something? my machine is: Dell Inspiron Mini netbook Ubutu lucid 10.04, 2bg RAM, 260GB HDD

View 1 Replies View Related

Fedora :: How To Skip Package Install Using Yum Update

Apr 3, 2010

My question is: How to skip the installation of a package when using yum update from the command line? i.e., How would one update a system from command line and skip/not update kernel?

View 4 Replies View Related

Fedora :: Can't Update System Even With The Skip-broken?

Oct 8, 2010

There is a problem with dependency resolution for the recent updates; i can't update my system even with the skip-broken, there is something to nautilus and phyton-devel and phyton, pls, take note of these.

View 3 Replies View Related

OpenSUSE :: How To Skip Auto-refresh After Installation

Sep 24, 2010

When i install openSUSE 11.3, reboot the system, and then yast stay in automatic configuration. It take a long time to download some packages, and it seems that it has no response already. How would i skip this step?

View 2 Replies View Related

OpenSUSE Install :: 11.3 - How To Skip Bootloader Installation

Aug 3, 2010

I just upgraded two 11.2 installations. One I easily managed from the dvd the other I had to install anew as the cd didn't offer the possibility of upgrading. While I appreciated the many improvements in desktop stability I found I am non very satisfied of the installer.

It became minimal and just does what IT wants and not what I want anymore. I miss the possibility of choosing desktops, programmes and settings during installation. Most of all I miss the possibility of choosing the bootloader and its location. I have a multi boot multi disk machine and I prefer to modify entries by hand so i never install the loader but add the new entry in the grub but this was not possible and it made just a mess erasing completely all other entries....

Booting has always been a great problem for one of my machines and I'm not going to upgrade it if thisi is the result. Is there a way of going back to the old options (no loader?) Why are the new installer always "easier" but less flexible for a user who's not geek but not even a newbie? Why does it have always to be more "Windows like"

View 5 Replies View Related

Ubuntu :: How To Skip Install Wizard On Live USB

Jun 6, 2010

I am using a live USB of 10.04 Netbook edition. Every time I boot up the Installation wizard opens. Is there a way to skip this and go directly to the gnome desktop? Figure I just need to edit some boot scripts but I dont know which one.

View 1 Replies View Related

Ubuntu :: Skip The Nautilus Overwrite Prompt?

Oct 14, 2010

Is it possible to have Nautilus stop prompting me to confirm file overwrites when copying files? This would be very practical (with the obvious risk, but still). I have not been able to find this somewhere...

View 1 Replies View Related

Ubuntu :: Skip The Grub Menu In Natty?

May 6, 2011

how to skip the grub menu in Natty? The way I used to do it in /etc/default/grub no longer works.

View 3 Replies View Related

Ubuntu :: Skip Startup Menu In Netbook 2d

May 21, 2011

I'm running maverick netbook remix on an asus1015pe eeepc. I recently switched from the unity interface to "ubuntu netbook 2d" - the one they say resembles the 10.04 netbook interface. I really like it - fast, crisp, and intuitive - but there's one thing I'd like to change, if possible. Right after login, there's a full-screen translucent menu that covers the 1st workspace. If I wait a few seconds, I can make it go away by clicking the "desktop" button in the bottom left, but is there any way to make it so it doesn't appear at all? so that after login it goes right to a clean desktop.

View 2 Replies View Related

Ubuntu :: Skip Authentication For System Updates?

Mar 7, 2011

I'm using Ubuntu Lucid Lynx and every time I search for updates it ask for authentication. I'd like to search and apply updates without confirmation. Is it possible in some manner?

View 4 Replies View Related

Networking :: Skip DHCP Request When Interface Is Down?

Apr 26, 2010

Google is full of users which cannot get a DHCP address So no matter what search term I use, I only see solutions which do not apply to this problem. I am running Debian Squeeze on a netbook eeePC 1001P I have a wireless interface and a wired interface defined in /etc/network/interfaces:

Code:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

[code]....

Both interfaces WORK! When I have plugged in a cable, eth0 acquires and gets an IP, when I am in reach of the WiFi, wlan0 gets an IP address. Now when I want to use only wireless, and I have no LAN connected, this is what happens at boot:

Code:

ADDRCONF(NETDEV_UP): eth0: link is not ready
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5

[code]....

This is fine, however it takes forever (I think 60 seconds) before DHCP decides to time out. That is awkward. This is my wife's computer and I cannot tell her to intervene manually when she is either in Wifi range or on the LAN. Why is dhclient called when it is detected that eth0 is not ready? How can I disable acquiring a DHCP address on an interface which is not ready? when a link is not ready, acquiring a DHCP address is skipped. How can I configure that? I have looked thru the ifup scripts, but nothing. Where do I see what is happening when the interface is auto eth0?

View 3 Replies View Related







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