I am new to shell script and need to edit an xml form script.
The XML file is something like code...
If the user selects element1, the script should modify only element1 values and not element2 values.
I need it to be done from bash script. I can't use python or perl for the same. Please provide me a way to do so.
I have made a simple bash script through which i can add, del, edit user from certain file using different CASE variables. like case 1. adduser 2. del user 3. edit user
Now i want to add a exit CASE like 1. adduser 2. del user 3. edit user 4. exit
Now i want to make a script such a way that, if user input is 4 then only script quit. I used with exit function also but it didn't work. if user press ENTER or other keys then also it quit the program.
I am trying to get a checksum for a file in a subscripted variable in a bash script. md5sum outputs a checksum and the name of the input file. For example:
Code: eval CSUM$K=$"(md5sum file)"
This might return something like this:
Code: 3cff5d5c0113959d0be62be34b97e05c file
I want to assign just the checksum to the variable in my shell script and omit the file name that follows. Is there something besides md5sum that will generate a checksum? Or if not, then I was thinking I might be able to extract the checksum without the file name using sed.
if I can create a bash script that once executer will edit or replace a line a in a file this line is the first one and its just one character that needs to be changed from a 1 to a 0.
How do I go about this? it is for a game called EVE Online, heres what my .sh look like atm
#!/bin/sh echo fixing prefs.ini #fix for prefs goes here echo starting eve eve
I've been trying to write a bash script that will change the gconf settings for docky. The goal is to make it have a setup similar to Elementary OS or Pinguy OS... that means one docky instance on the bottom and one on the left. I just can't seem to get the commands working right at all. This is one setting I have been trying to change but every time I get an error about primitive types.gconftool --type List --set /schemas/apps/panel/general/toplevel_id_list [top_panel]
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code: #!/bin/bash cat > ~/generateGridmix2data.sh << END
What happens when the script executes is that the ssh connection works and parks me at the remote hosts's shell login. Therefore, the "firefox" command refuses to execute. I need to know how to make the "ssh" connection occur, stay open, and go into the background so that the rest of the script can execute.If I could also do this with the "firefox" line so that the entire term window could be closed would also be helpful.
can I change the ECC code for a block of a file stored on a flash drive by any means ? of a file stored on a HDD (though I don't think there would be a difference between the two)Maybe , through some hardware interrupts or anything like that?Also if possible I need the solution to be in C/C++.
I am having big trouble with rc.local on my system.My system is CentOS 5.5 64X.My default startup is is 3, so rc3.d is where I was looking into.rc.local with permissions 755.Inorder to solve the problem I made the following test . 1. No matter how I edit rc.local, it will not be executed, even a copy from other Linux system that runs rc.local fine. 2. All S99 service under rc3.d won't run when S99local is there. 3. All service executed just fine if S99local removed from rc3.d. 4. If I change S99local to S97local, Anything in S97, S98, S99 won't run. 5. I tested rc.local with Code:echo "rc.local is executed just fine" >> /root/test.txt by adding it after "touch /var/lock/subsys/local" [FAILED, test.txt not found after restart] 6. I tried to execute rc.local with Code:sh /etc/rc.local it was SUCCESSFULLY executed without any error, and everything in rc.local runs fine.
send pings test for hours to my router 10.0.1.1 and the ping test is perfect, never fail. 8024 send packages, 8024 packages received. Now but when make the same ping tests for hours to my linux CPU, i saw that sometimes the ping test say timeout Whan can i do? Can i edit the timeout value for in my linux cpu? what you think? This is making me crazy because me linux cpu is loosing packages..
Code: [root@TornadoR3 ~]# ifconfig eth1 Link encap:Ethernet HWaddr 00:08:02:F9:AB:FF[code].....
I am learning vi and like it so far. I am writing Python code with it and would like to change my tabs from 8 spaces to 4. I saw somewhere that I should edit my .vimrc file and add :set tabstop=4, but I cannot find it (even when I run :version in vi, it tells me where my user and system .vimrc files are, but I cannot find them there).
I use a linux machine at work and a mac at home. I can ssh from my machine at home to my work machine. But the only editor that I have access to on the command line then is vi, which I don't like.
Is there a way to use gedit on my mac to edit files remotely over an ssh connection?
This page says that it can be done, but I think that it assumes that you are using gedit on ubuntu. On my mac (os 10.5.8) I don't have the "bookmark" option when I click "connect to server".
My computer's fine, and is running Puppy Linux happily, but I'm having trouble entering my BIOS menu (I forget the access key, and no matter which keys I try, Puppy Linux boots up).
Is it possible to edit BIOS settings from a LiveCD?
I have gone over the thread "Learn The DD Command Revised" (It was Fantastic) in the search for a solution to my query.
I have seen posted elsewhere that this code is supposed to be able to change the UUID number of NTFS partitions (useful when multi-booting with Grub2 and cloning partitions). Here is the code:
Code: sudo dd if=/dev/urandom bs=80 count=1 | xxd -l 80 -c 8 | tail -1 | xxd -r - /dev/sda1 This is assuming that I want to change the UUID on the 1st partition on the 1st hard drive >>>sda1<<< If I was trying to modify the 2nd partition on the 1st hard drive it would be >>>sda2<<<
[Code].....
NOTE: I was doing this while booting from Ubuntu's Live CD version 10.04.1 LTS (In case that is a factor)
I need to have regular user run this command sync; echo 3 > /proc/sys/vm/drop_caches
but it requires root privileges that I cannot give.
So I figured they could run the command as "sudo". I looked in /etc/sudoers and wasn't sure what I needed to edit for the users to run the following command
I have a directory with hundreds of html files. For all the files I have to: - delete all the row from the beginning of the file to the sentence "<img src="immagini/_navDxBottom.gif" />".
- delete all the rows from the sentence "<br clear="right" />" to the end of the file.
The default setting of linux is run level 5 (Red Hat 9) I want to use my system in Runlevel 1. For that purpose i 1st check the permission which were
-rw-r--r--
I want to edit the File " vim /etc/inittab " in the terminal . which line should i edit so I may use it in a single mode.
2-The second thing i want to ask that before editing any important file which are /etc like "inittab" can i 1st make it's copy and keep it in my home directoty so,in case of any mistake I can get my original file?
I installed 3 OS in my computer, first Windows xp, second Ubuntu 10.10 up to here I could go in to each one of them, but I installed Fedora 14 x64 after Ubuntu. Now I can only go to Fedora and XP, but I am not able to even see Ubuntu only in the shell, it is not in my boot options.
I'm needing to read the Adam's Assembly Tutorials, that are old EDIT *.txt files, I'm on Linux and I need to read this files.What can I do?Is there any GUI editor that can read the files?There is any way to convert them into another file that is more modern1?