Search Results

Search: Posts Made By: Phil3759
6,710
Posted By Phil3759
Yes, mainly to run commands, using quotes is...
Yes, mainly to run commands, using quotes is important in my opinion
To assign variables, it can be optional in some cases
6,710
Posted By Phil3759
yes, just a habit to limit errors if spaces under...
yes, just a habit to limit errors if spaces under some functions
Thank you
6,710
Posted By Phil3759
Thank you It is ok, I got it. I never did...
Thank you
It is ok, I got it.

I never did such a thing. Was debugging quickly my script and wanted to test the whole line without a second thought. Once it failed, I did not know that the shell...
6,710
Posted By Phil3759
Thank you for the basic explanation. I know well...
Thank you for the basic explanation. I know well about the the splitting at spaces for unquoted variables, but thought that single quoting stops this.

Even single quoting won't make it work...
6,710
Posted By Phil3759
yes, potential good explanation It is really...
yes, potential good explanation
It is really the first time I use such a way
In any case it was my initial debugging script. The final script goes the clean ways like you did, by splitting things...
6,710
Posted By Phil3759
Thank you both, really @Corona688: no, I am...
Thank you both, really

@Corona688: no, I am not going to use eval of course, but like hanson44 said, I am very curious.

Why the command is in a variable?
Well, the script sample is part of a...
6,710
Posted By Phil3759
Very interesting splitting the cmd line like...
Very interesting

splitting the cmd line like you suggested works perfectly, with or without quoting the variables

Now, running my single line $CMD_LINE1 with -xv debug mode gives this:
...
6,710
Posted By Phil3759
I will try it and report back, thanks
I will try it and report back, thanks
6,710
Posted By Phil3759
Well, Thanks to you, I could repeat and...
Well,
Thanks to you, I could repeat and reproduce the exact issue cause. Here's what I messed with:

In fact, after only removing nohup from exactly above script, my script still works perfectly
...
6,710
Posted By Phil3759
Sure, I use that source to compile it along...
Sure, I use that source to compile it along cyanogenmod source
No error about the called binary as I use full path to call it, not in PATH var

Here's the output from nohup you asked for

Shell:...
6,710
Posted By Phil3759
Thank you for the support Well, the source...
Thank you for the support

Well, the source is here:
https://github.com/CyanogenMod/android_system_core/blob/cm-10.1/cpio/mkbootfs.c

I "quickly" followed the source and I see no terminal check...
6,710
Posted By Phil3759
If you read well my first post you'll see that I...
If you read well my first post you'll see that I did:
1- run this from command line in terminal: works perfect

mkbootfs /path/to/root > /path/to/ramdisk-recovery.cpio


2- put same line in...
6,710
Posted By Phil3759
Thanks, Well, I can do it easily using find . |...
Thanks,
Well, I can do it easily using find . | cpio ...

However, I was a bit confused to not be able to use mkbootfs in a shell script while it works in cmd line

By the way, after further...
6,710
Posted By Phil3759
Mkbootfs writing to stdout in bash script
Hi,

I need to automate some repacking tasks of a boot image for Android
When in command line, I can use this command:

mkbootfs /path/to/root > /path/to/ramdisk-recovery.cpio;However, if I try...
8,686
Posted By Phil3759
Now, I got all the guns I need to fire the data...
Now, I got all the guns I need to fire the data file ;)
Thank you again, you made my day :b:
8,686
Posted By Phil3759
I got it know Thank you for all the time you...
I got it know
Thank you for all the time you spent with my issue

A last (I hope) question

What would be the next 2 commands if I want to insert new_pattern before the pattern

Actual insert...
8,686
Posted By Phil3759
I am really greatful. Actually, this line was too...
I am really greatful. Actually, this line was too much for my knowledge
Both the classic and performance ones do work as expected for replace/insert pattern

Now, just for my knowledge (feel free...
8,686
Posted By Phil3759
data.db on post-fs-data # We chown/chmod...
data.db
on post-fs-data
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data

# Create dump dir and collect dumps....
8,686
Posted By Phil3759
You got it right pattern can sometimes be...
You got it right

pattern can sometimes be surrounded by white spaces
pattern=" system /path1/file1 file1 "
but sometimes only:

pattern="system /path1/file1 file1"

and sometimes a tab...
8,686
Posted By Phil3759
Ah, I see No way to see in terminal as data.db...
Ah, I see
No way to see in terminal as data.db contents are too long
I redirected to a text file with this command:

pattern="system /path1/file1 file1"
new_pattern=" data /path2/file2 file2"...
8,686
Posted By Phil3759
Thank you but it did not work I just made n=1 ...
Thank you but it did not work
I just made n=1
Output was the content of my data.db file in terminal
and the file data.db was not edited
:wall:
8,686
Posted By Phil3759
Insert new pattern in newline after the nth occurrence of a line pattern - Bash in Ubuntu 12.04
Hi,

I am getting crazy after days on looking at it:
Bash in Ubuntu 12.04.1

I want to do this:
pattern="system /path1/file1 file1"
new_pattern=" data /path2/file2 file2"
file to edit:...
3,162
Posted By Phil3759
Thank you a lot for the support Using case...
Thank you a lot for the support

Using case in: again, no advantage over grep, as both are external commands to the shell. Using Grep permits me to continue with the if/else structure
Any other...
3,162
Posted By Phil3759
Look for, backup and delete symlinks
Hi,

My first post here:
Was looking if someone can help enhancing my code.
I am limited to sh or ash shell (android / busybox)

I made a script to look for busybox symlinks, backup them and...
Showing results 1 to 24 of 24

 
All times are GMT -4. The time now is 09:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy