Questions tagged [scripting]

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

Scripting is usually done in a scripting language. Such scripting languages are often dynamically typed and interpreted, as opposed to compiled languages. Examples of such languages include PowerShell, Perl and Bash.

1826 questions
19
votes
8 answers

How do I become a scripting guy?

I am a fairly new Windows Systems Administrator. I have done some basic batch files and some other scripting. I would like to know what path I should take to become a better scripter. What language should I study and what are the best resources…
user36440
  • 325
  • 2
  • 9
18
votes
7 answers

PowerShell prompt to continue execution of code

I have a script I am using to automate WSUS processes, and the last stage of it goes on to remove all old/unnecessary files/objects. I would like to prompt 'Press 'Enter' to continue with removal or any other key to stop' before the cleanup stage to…
Abraxas
  • 1,229
  • 1
  • 16
  • 25
18
votes
7 answers

How to parse and convert ini file into bash array variables?

I'm trying to convert an ini file into bash array variables. The sample ini is as below: [foobar] session=foo path=/some/path [barfoo] session=bar path=/some/path so these…
Flint
  • 631
  • 5
  • 10
  • 18
17
votes
4 answers

In CentOS 4.4, how can I strip escape sequences from a text file?

What command can I use to strip color-code escape sequences from a text file? Ideally something I can pipe through. If I have a file with a bunch of coloured text rainbow.txt, what goes in the gap: cat rainbox.txt | *something* > plain.txt I'm…
kdt
  • 1,400
  • 3
  • 22
  • 34
17
votes
5 answers

How to automatically run a script when the contents of a directory changes in Linux?

I want to automatically run a script whenever new files are copied into a particular directory. In other words, is there a way in Linux to "watch" a directory for changes and then run something in response to the change?
GeneQ
  • 407
  • 2
  • 8
  • 17
17
votes
4 answers

Vim - Trigger action\script on save\write?

This might be better for super user, but I figure as a tool of the trade it might be a better topic for here. I find often when editing in vim that I exit out, run some script that I am testing, and then go back into vim (yes I realize I can use…
Joshua Enfield
  • 3,454
  • 8
  • 42
  • 59
16
votes
3 answers

Using ICACLS to set permissions on user directories

I'm trying to reset permissions on user directories and having a bit of trouble with the last step of my script. My script basically takes ownership of the entire user directory, resets the permissions on all files and folders for the directory,…
pk.
  • 6,451
  • 2
  • 42
  • 63
15
votes
6 answers

How can I easily convert HTML special entities from a standard input stream in Linux?

CentOS Is there an easy way to convert HTML special entities from a data stream? I'm passing data to a bash script and sometimes that data includes special entities. For example: "test" & test $test ! test @ # $ % ^ & * I'm not sure why…
Mike B
  • 11,871
  • 42
  • 107
  • 168
15
votes
3 answers

Dismount USB External Drive using powershell

I am attempting to dismount an external USB drive using powershell and I cannot successfully do this. The following script is what I use: #get the Win32Volume object representing the volume I wish to eject $drive = Get-WmiObject Win32_Volume…
JB.
  • 253
  • 1
  • 2
  • 6
14
votes
6 answers

Bash script to retrieve name of Ethernet Network interface

In Ubuntu 16.04 I made a script to dinamically configure IP address of the wired ethernet interface based on certain parameters. Now the problem is that in my script I assume that the name is eth0, but this is not always true.. assuming that I have…
rok
  • 243
  • 1
  • 2
  • 7
14
votes
4 answers

Is it possible to change BIOS settings from Linux?

I'm trying to write a script to enable IPMI on a ton of machines without having to hook up a KVM to them one by one. Is it possible to change the BIOS settings from Linux? OS is SL6. I understand that each machine will likely need to be power…
cat pants
  • 2,273
  • 10
  • 35
  • 46
14
votes
6 answers

Using mysqldump in cron job without root password

If I login with the root password on my box I can simply type mysqldump --all-databases and I will get th expected "Dump". I setup a job in cron.daily to run and dump this to a backup drive. The problem I have is that although the user is running…
Mech
  • 660
  • 2
  • 11
  • 22
14
votes
5 answers

How to add a script to startup and shutdown in debian?

the title pretty much sums it up. how do I add a startup.sh and shutdown.sh of my server app to the startup and shutdown sequence of the Debian OS?
Amir Arad
  • 547
  • 2
  • 8
  • 11
13
votes
4 answers

Best book for learning linux shell scripting?

I normally works on Windows machines but on some occasions I do switch to development on linux. And my most recent project will be written entirely on a certain linix platforms (not the standard Apache/MySQL/PHP setup). So I thought it would pay to…
chakrit
  • 417
  • 2
  • 6
  • 15
13
votes
2 answers

What is the industry standard method for administering the change of the local administrator password for all machines on a domain?

Although there appears to be three available options, one of which is actually secure, there seems to be only two available choices that will be able to impact machines that are not powered on at the time of change or are mobile and were not on the…