Question about Computers & Internet

1 Answer

Need help batch script #!/bash/sh

I would like to know how to do a batch script for this please: Find all files within the /home folder {including sub- folders), delonging to a user that are not in that user's home folder. The chosen user's name is to be prompted and entered from the keyboard. The user's home folder can be retrieved from the /etc/passwd file. This is to be from the root user. can you help me?? thanks katrena

Posted by on

  • trenny Sep 23, 2007

    No this didnt help I need a batch script as #!/bash/sh
    etc which is complete. If anyone could help I will be very happy

×

Ad

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    Superstar:

    An expert that got 20 achievements.

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

  • Master
  • 2,427 Answers

Google batch script programming to get tutioral and other info on batch scripting

all the batch needs to do id change its directory to the directory you want and then just use other commands to do what you want with the files
e.g

cd\
cd Documents and settings
cd user
cd temp
del *.*

Posted on Dec 30, 2007

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
A 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
The service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
Good luck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

Can anyone explain how batch file works?


This is kind of tricky not knowing how familiar you are with the commandline, but a batch file simply contains single commands and executes them in order (usually from top to bottom). A batch file (or bash script in Linux) can be very helpful if you have to run certain commands over and over again, so you don't have to write them by hand.

An Example: You want to store your network settings in a text file.
You open the command prompt (WIN+R) and type this line:
mkdir C:\Network
Then you type this line:
ipconfig /all > C:\Network\ipconfig.txt
The first line creates a folder on your C: drive called "Network"
The second line runs the ipconfig command and saves it as a text file in that new folder.

To make a batch file, you open Notepad and insert the two lines. Then save it as "IP.bat" (make sure not to save it as "IP.bat.txt"! This is the most common mistake. If you save a file from Notepad, select "All Files" in the "Save As Type" dialog. Otherwise it will save it as a .txt file and you have to rename it later.)

Now you can double click the batch file and it runs all commands in the file.

You can also see the danger. If you run a batch file and don't know what it really does, it can destroy your whole system. So make sure you understand it and/or get it from a trustworthy source.

A nice example of how complex a batch file can be is here:
AllHelp.bat

Copy the content into a text file, save it as AllHelp.bat, run it and it will create a webpage with all available DOS commands.

Hope this helps - otherwise let me know if you have specific questions.
Enjoy!

Feb 26, 2012 | HEWLETT-PACKARD Computers & Internet

1 Answer

How to write script in 2003 domaincontroller


lease follow steps to resolve your issue

First, open "Active Directory Users and Computers" on the domain controller

Now right click on the user you want to have the logon script and select the properties menu.
A properties dialog like the one shown below will appear. Select the ‘Profile’ Tab

Here is the confusing part. If I just put any old batch file name in the logon script field, where does windows try to find it from?
Lets find out. First, type in this field ‘logon.bat’
Click OK.
Now, we need to find the folder where the server loads logon scripts. It follows this format:
\\(SERVERNAME)\sysvol\(DOMAIN NAME)\scripts
So, if my server was named DCServer1, and my domain was intelliadmin.com, we would browse to this path:
\\DCServer1\sysvol\intelliadmin.com\scripts

Now that we know where to put it, creating the script is easy. Just open up notepad, and write your batch file. For our test batch file we will put in a line that loads our profile generator for Microsoft Outlook XP

We are done with the script, so we save the text file as:
\\DCServer1\sysvol\intelliadmin.com\scripts\logon.bat
Now, the next time this user logs in, they will load the login script.
hope it can resolved your issue
thanks

May 14, 2010 | Computers & Internet

1 Answer

How to write script in 2003 domaincontroller


Hi

please follow steps to resolve your issue

First, open "Active Directory Users and Computers" on the domain controller

Now right click on the user you want to have the logon script and select the properties menu.
A properties dialog like the one shown below will appear. Select the ‘Profile’ Tab

Here is the confusing part. If I just put any old batch file name in the logon script field, where does windows try to find it from?
Lets find out. First, type in this field ‘logon.bat’
Click OK.
Now, we need to find the folder where the server loads logon scripts. It follows this format:
\\(SERVERNAME)\sysvol\(DOMAIN NAME)\scripts
So, if my server was named DCServer1, and my domain was intelliadmin.com, we would browse to this path:
\\DCServer1\sysvol\intelliadmin.com\scripts

Now that we know where to put it, creating the script is easy. Just open up notepad, and write your batch file. For our test batch file we will put in a line that loads our profile generator for Microsoft Outlook XP

We are done with the script, so we save the text file as:
\\DCServer1\sysvol\intelliadmin.com\scripts\logon.bat
Now, the next time this user logs in, they will load the login script.
Check out our Windows Admin Tools
Filed Under: Windows

hope it can resolved your issue
thanks for using fixya

Mar 25, 2010 | Computers & Internet

2 Answers

Batch convert image files, that keeps a folder tree?


If your not using version 2.20 then upgrade because there is no limit according to the manufacturer.

Dec 14, 2009 | Microsoft Windows XP Home Edition

6 Answers

PhotoShop CS3 Droplet automation


Try the following steps
  1. Choose File => Automate => Create Droplet.
  2. Specify where to save the droplet. Click Choose in the Save Droplet In section of the dialog box and navigate to the location.
  3. Select the Action Set, and then designate which action you intend to use within the Set and Action menus. (Select the action in the Actions palette before you open the dialog box to preselect these menus.
  4. Set Play options for the droplet:
    a. Override Action “Open” Commands Open commands in the action refer to the batched files, rather than to the file names specified in the action. Deselect Override Action “Open” Commands if the action was recorded to operate on open files or if the action contains Open commands for specific files that are required by the action.
    b. Include All Subfolders Processes files in subdirectories.
    c. Suppress Color Profile Warnings Turns off display of color profile messages.
    d. Suppress File Open Options Dialogs Hides File Open Options dialog boxes. This is useful when batching actions on camera raw image files. The default or previously specified settings will be used.
  5. Choose a destination for the processed files from the Destination menu:
    a. None Leaves the files open without saving changes (unless the action includes a Save command).
    b. Save And Close Saves the files in their current location, overwriting the original files.
    c. Folder Saves the processed files to another location. Click Choose to specify the destination folder.

    Note: You can record an action that saves using a specified file name and folder. If you do this and deselect Override Action “Save As” Commands, the same file is overwritten each time. If you record your Save As step in the action without specifying a file name, the droplet saves it to the same folder each time but uses the file name of the document being saved.

  6. If the action includes a Save As command, choose Override Action “Save As” Commands to make sure files are saved to the folder you specified (or to their original folder if you chose Save And Close.) To use this option, the action must contain a Save As command, whether or not it specifies a save location or file name; otherwise, no files are saved.

    Some save options are not available in the Batch command (such as JPEG compression or TIFF options). To use these options, record them in the action, then use the Override Action “Save As” Commands option to make sure that your files are saved where you specify in the Batch command.

  7. If you chose Folder as the destination, specify a file-naming convention and select file compatibility options for the processed files:
    a. For File Naming, select elements from the pop‑up menus or enter text into the fields to be combined into the default names for all files. Elements include document name, serial number or letter, file creation date, and file extension. Starting Serial Number specifies the starting number for any serial number fields. Serial letter fields always start with the letter “A” for the first file.
    b. For Compatibility, choose Windows, Mac OS, and UNIX to make file names compatible with Windows, Mac OS, and UNIX operating systems.
  8. Select an option for error processing from the Errors pop‑up menu:
    a. Stop For Errors Suspends the process until you confirm the error message.
    b. Log Errors To File Records each error in a file without stopping the process. If errors are logged to a file, a message appears after processing. To review the error file, open it in a text editor after the Batch command runs.
Give it a try.........

Jul 30, 2009 | Computers & Internet

4 Answers

Lumix FZ20 - Splits and discolors tiff/high-res images - jpgs are ok


I just encountered the same problem with tiffs and a kind friend wrote me a Mac terminal script to fix it since I couldn't run Windows' Irfanview and do 'swap colors rgb to brg.' That still left the slices to move anyway.

I also emailed Lemke Graphic Converter and he put the fix in version 6.4.2. Open the program, go to file/convert and modify, navigate to the image in the left window, choose function/fix Lumix FZ20 2 gigabyte tifs in the dropdown and click go. I imagine if you select all the images and click go it will batch them.

Here's the terminal script. It needs to be put in a plain text document named  'fixtiff.sh'. 

for FILE in "$@"
do
echo "Fixing file $FILE"
dd if=$FILE of=1 bs=16384 count=1
dd if=$FILE of=2 bs=16384 skip=2
cat 1 2 > temp/$FILE
rm 1 2
done


Then follow these instructions:

1.  Make a NEW folder called "PhotosFix" or something friendly on your Desktop. If you name it something different, be sure and use the new name in each step below.

2.  Put the "fixtiff.sh" file into the "PhotosFix" folder above.

3.  COPY (copy, not move!) all your photos into the "PhotosFix" folder as well

4.  Open Terminal.  After each command below, hit enter. I've added space to make it clear which part is the UNIX command.

5.  Type    cd ~/Desktop/PhotosFix              (changes to your home folder)

6.  Type    mkdir ~/Desktop/PhotosFix/temp      (makes a TEMP folder - where the fixed files will be)

7.  Type    chmod +x fixtiff.sh                 (makes the script "run-able")

8.  Type    ls *.TIF > list.txt                 (makes a list of all your TIF files in list.txt)

On my computer I needed to do an 8b. Type     bash     (had a different shell than the creator)

9.  Type    for tiffimage in $(<./list.txt); do ./fixtiff.sh $tiffimage; done     (does the conversion!)

Step #9 is where the work begins.  What it does is run the fixtiff.sh script on every file in the list.txt list that is made in Step 8. The script itself takes the first part of the file, skips the 16k of garbage, and then adds the rest of the file.

Some important notes:

1.  There cannot be ANY spaces in the file names.  None at all!

2.  Files MUST have a .TIF extension on them. (the ones you sent both did)

3.  All the "fixed" images will be in your /Desktop/PhotosFix/temp folder

Terrie






Nov 02, 2008 | Panasonic Lumix DMC-FZ20 Digital Camera

1 Answer

Linux scripting


Have you tried this link: www.linuxquestions.org

Sep 22, 2007 | Computers & Internet

1 Answer

Lunix scripting


Assuming you have ALLCORES directory: su - root find /tmp -type f -name core -exec mv {} ~/ALLCORES \;

Sep 22, 2007 | Computers & Internet

1 Answer

Bash scripts


bash script? or do you mean Batch Script?

Sep 21, 2007 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

259 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18424 Answers

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

David Payne
David Payne

Level 3 Expert

14162 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...